use.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2004-2008 Maciej Sobczak, Stephen Hutton
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt or copy at
5 // http://www.boost.org/LICENSE_1_0.txt)
6 //
7 
8 #ifndef SOCI_USE_H_INCLUDED
9 #define SOCI_USE_H_INCLUDED
10 
11 #include "soci-backend.h"
12 
13 namespace soci
14 {
15 
16 namespace details
17 {
18 template <typename T, typename Indicator>
20 {
21  use_container(T &_t, Indicator &_ind, const std::string &_name)
22  : t(_t), ind(_ind), name(_name) {}
23 
24  T &t;
25  Indicator &ind;
26  const std::string &name;
27 };
28 
29 typedef void no_indicator;
30 template <typename T>
31 struct use_container<T, no_indicator>
32 {
33  use_container(T &_t, const std::string &_name)
34  : t(_t), name(_name) {}
35 
36  T &t;
37  const std::string &name;
38 };
39 
40 } // namespace details
41 
42 template <typename T>
43 details::use_container<T, details::no_indicator> use(T &t, const std::string &name = std::string())
45 
46 template <typename T>
47 details::use_container<const T, details::no_indicator> use(T const &t, const std::string &name = std::string())
49 
50 template <typename T>
51 details::use_container<T, indicator> use(T &t, indicator & ind, std::string const &name = std::string())
53 
54 template <typename T>
55 details::use_container<const T, indicator> use(T const &t, indicator & ind, std::string const &name = std::string())
57 
58 // vector containers
59 template <typename T>
61  use(T &t, std::vector<indicator> & ind, const std::string &name = std::string())
63 
64 template <typename T>
66  use(std::vector<T> &t, const std::string &name = std::string())
67 { return details::use_container<std::vector<T>, details::no_indicator>(t, name); }
68 
69 } // namespace soci
70 
71 #endif // SOCI_USE_H_INCLUDED
use_container(T &_t, Indicator &_ind, const std::string &_name)
Definition: use.h:21
use_container(T &_t, const std::string &_name)
Definition: use.h:33
void no_indicator
Definition: into.h:37
const std::string & name
Definition: use.h:26
details::use_container< T, details::no_indicator > use(T &t, const std::string &name=std::string())
Definition: use.h:43


asr_lib_ism
Author(s): Hanselmann Fabian, Heller Florian, Heizmann Heinrich, Kübler Marcel, Mehlhaus Jonas, Meißner Pascal, Qattan Mohamad, Reckling Reno, Stroh Daniel
autogenerated on Wed Jan 8 2020 04:02:41