Lines Matching full:tuple
2 $var n = 10 $$ Maximum number of tuple fields we want to support.
35 // Implements a subset of TR1 tuple needed by Google Test and Google Mock.
43 // that prevents us from declaring the tuple template as a friend (it
44 // complains that tuple is redefined). This hack bypasses the bug by
50 template <GTEST_$(n)_TYPENAMES_(U)> friend class tuple; \
58 // GTEST_n_TUPLE_(T) is the type of an n-tuple.
59 #define GTEST_0_TUPLE_(T) tuple<>
64 #define GTEST_$(k)_TUPLE_(T) tuple<$for m, [[T##$m]]$for m2 [[, void]]>
84 class tuple;
113 // iff k < the number of fields in tuple type T.
114 template <bool kIndexValid, int kIndex, class Tuple>
128 class tuple<> {
130 tuple() {}
131 tuple(const tuple& /* t */) {}
132 tuple& operator=(const tuple& /* t */) { return *this; }
139 class $if k < n [[GTEST_$(k)_TUPLE_(T)]] $else [[tuple]] {
143 tuple() {}
145 explicit tuple($for m, [[GTEST_BY_REF_(T$m) f$m]]) : [[]]
148 tuple(const tuple& t) : $for m, [[f$(m)_(t.f$(m)_)]] {}
151 tuple(const GTEST_$(k)_TUPLE_(U)& t) : $for m, [[f$(m)_(t.f$(m)_)]] {}
155 tuple(const ::std::pair<U0, U1>& p) : f0_(p.first), f1_(p.second) {}
159 tuple& operator=(const tuple& t) { return CopyFrom(t); }
162 tuple& operator=(const GTEST_$(k)_TUPLE_(U)& t) {
168 tuple& operator=(const ::std::pair<U0, U1>& p) {
179 tuple& CopyFrom(const GTEST_$(k)_TUPLE_(U)& t) {
197 // 6.1.3.2 Tuple creation functions.
203 inline tuple<> make_tuple() { return tuple<>(); }
215 // 6.1.3.3 Tuple helper classes.
217 template <typename Tuple> struct tuple_size;
226 template <int k, class Tuple>
229 k < (tuple_size<Tuple>::value), k, Tuple>::type type;
232 #define GTEST_TUPLE_ELEMENT_(k, Tuple) typename tuple_element<k, Tuple >::type
243 template <class Tuple>
244 static GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple))
245 Field(Tuple& t) { return t.f$(i)_; } // NOLINT
247 template <class Tuple>
248 static GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_($i, Tuple))
249 ConstField(const Tuple& t) { return t.f$(i)_; }