Lines Matching full:tuple
32 #include <gtest/internal/gtest-tuple.h>
40 using ::std::tr1::tuple;
45 // Tests that tuple_element<K, tuple<T0, T1, ..., TN> >::type returns TK.
47 StaticAssertTypeEq<int, tuple_element<0, tuple<int, char> >::type>();
48 StaticAssertTypeEq<int&, tuple_element<1, tuple<double, int&> >::type>();
49 StaticAssertTypeEq<bool, tuple_element<2, tuple<double, int, bool> >::type>();
52 // Tests that tuple_size<T>::value gives the number of fields in tuple
55 EXPECT_EQ(0, +tuple_size<tuple<> >::value);
56 EXPECT_EQ(1, +tuple_size<tuple<void*> >::value);
57 EXPECT_EQ(1, +tuple_size<tuple<char> >::value);
58 EXPECT_EQ(1, +(tuple_size<tuple<tuple<int, double> > >::value));
59 EXPECT_EQ(2, +(tuple_size<tuple<int&, const char> >::value));
60 EXPECT_EQ(3, +(tuple_size<tuple<char*, void, const bool&> >::value));
63 // Tests comparing a tuple with itself.
65 const tuple<int, char, bool> a(5, 'a', false);
73 const tuple<int, bool> a(5, true), b(5, true);
81 typedef tuple<const int, char> FooTuple;
97 typedef tuple<int&, const char&> FooTuple;
117 // Tests that a tuple field with a reference type is an alias of the
121 tuple<bool, int&> t(true, n);
138 // Tests tuple's default constructor.
141 tuple<> empty;
142 tuple<int> one_field;
143 tuple<double, char, bool*> three_fields;
146 // Tests constructing a tuple from its fields.
150 tuple<int&> a(n);
154 tuple<int, char> b(5, 'a');
160 tuple<bool, const int&> c(true, m);
165 // Tests tuple's copy constructor.
167 tuple<double, bool> a(0.0, true);
168 tuple<double, bool> b(a);
174 // Tests constructing a tuple from another tuple that has a compatible
177 tuple<int, int, char> a(0, 1, 'a');
178 tuple<double, long, int> b(a);
185 // Tests constructing a 2-tuple from an std::pair.
188 tuple<int, char> b(a);
189 tuple<int, const char&> c(a);
192 // Tests assigning a tuple to another tuple with the same type.
194 const tuple<int, long> a(5, 7L);
195 tuple<int, long> b;
201 // Tests assigning a tuple to another tuple with a different but
204 const tuple<int, long, bool> a(1, 7L, true);
205 tuple<long, int, bool> b;
212 // Tests assigning an std::pair to a 2-tuple.
215 tuple<int, bool> b;
220 tuple<long, bool> c;
229 typedef tuple<int, int, int, int, int, int, int, int, int, int> BigTuple;
244 // Tests that get<N>(t) returns the N-th (0-based) field of tuple t.
249 // Tests that get() works on a const tuple too.
265 tuple<bool, int> a;
270 tuple<char, int, long> b;
282 tuple<const char*, int*> t;