Lines Matching full:t

56 // GTEST_n_TUPLE_(T) is the type of an n-tuple.
57 #define GTEST_0_TUPLE_(T) tuple<> argument
58 #define GTEST_1_TUPLE_(T) tuple<T##0, void, void, void, void, void, void, \ argument
60 #define GTEST_2_TUPLE_(T) tuple<T##0, T##1, void, void, void, void, void, \ argument
62 #define GTEST_3_TUPLE_(T) tuple<T##0, T##1, T##2, void, void, void, void, \ argument
64 #define GTEST_4_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, void, void, void, \ argument
66 #define GTEST_5_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, void, void, \ argument
68 #define GTEST_6_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, void, \ argument
70 #define GTEST_7_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \ argument
72 #define GTEST_8_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \ argument
73 T##7, void, void>
74 #define GTEST_9_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \ argument
75 T##7, T##8, void>
76 #define GTEST_10_TUPLE_(T) tuple<T##0, T##1, T##2, T##3, T##4, T##5, T##6, \ argument
77 T##7, T##8, T##9>
79 // GTEST_n_TYPENAMES_(T) declares a list of n typenames.
80 #define GTEST_0_TYPENAMES_(T) argument
81 #define GTEST_1_TYPENAMES_(T) typename T##0 argument
82 #define GTEST_2_TYPENAMES_(T) typename T##0, typename T##1 argument
83 #define GTEST_3_TYPENAMES_(T) typename T##0, typename T##1, typename T##2 argument
84 #define GTEST_4_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ argument
85 typename T##3
86 #define GTEST_5_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ argument
87 typename T##3, typename T##4
88 #define GTEST_6_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ argument
89 typename T##3, typename T##4, typename T##5
90 #define GTEST_7_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ argument
91 typename T##3, typename T##4, typename T##5, typename T##6
92 #define GTEST_8_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ argument
93 typename T##3, typename T##4, typename T##5, typename T##6, typename T##7
94 #define GTEST_9_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ argument
95 typename T##3, typename T##4, typename T##5, typename T##6, \
96 typename T##7, typename T##8
97 #define GTEST_10_TYPENAMES_(T) typename T##0, typename T##1, typename T##2, \ argument
98 typename T##3, typename T##4, typename T##5, typename T##6, \
99 typename T##7, typename T##8, typename T##9
117 // ByRef<T>::type is T if T is a reference; otherwise it's const T&.
118 template <typename T>
119 struct ByRef { typedef const T& type; }; // NOLINT
120 template <typename T>
121 struct ByRef<T&> { typedef T& type; }; // NOLINT
124 #define GTEST_BY_REF_(T) typename ::std::tr1::gtest_internal::ByRef<T>::type
126 // AddRef<T>::type is T if T is a reference; otherwise it's T&. This
127 // is the same as tr1::add_reference<T>::type.
128 template <typename T>
129 struct AddRef { typedef T& type; }; // NOLINT
130 template <typename T>
131 struct AddRef<T&> { typedef T& type; }; // NOLINT
134 #define GTEST_ADD_REF_(T) typename ::std::tr1::gtest_internal::AddRef<T>::type
139 // A helper for implementing tuple_element<k, T>. kIndexValid is true
140 // iff k < the number of fields in tuple type T.
144 template <GTEST_10_TYPENAMES_(T)>
145 struct TupleElement<true, 0, GTEST_10_TUPLE_(T) > {
149 template <GTEST_10_TYPENAMES_(T)>
150 struct TupleElement<true, 1, GTEST_10_TUPLE_(T) > {
154 template <GTEST_10_TYPENAMES_(T)>
155 struct TupleElement<true, 2, GTEST_10_TUPLE_(T) > {
159 template <GTEST_10_TYPENAMES_(T)>
160 struct TupleElement<true, 3, GTEST_10_TUPLE_(T) > {
164 template <GTEST_10_TYPENAMES_(T)>
165 struct TupleElement<true, 4, GTEST_10_TUPLE_(T) > {
169 template <GTEST_10_TYPENAMES_(T)>
170 struct TupleElement<true, 5, GTEST_10_TUPLE_(T) > {
174 template <GTEST_10_TYPENAMES_(T)>
175 struct TupleElement<true, 6, GTEST_10_TUPLE_(T) > {
179 template <GTEST_10_TYPENAMES_(T)>
180 struct TupleElement<true, 7, GTEST_10_TUPLE_(T) > {
184 template <GTEST_10_TYPENAMES_(T)>
185 struct TupleElement<true, 8, GTEST_10_TUPLE_(T) > {
189 template <GTEST_10_TYPENAMES_(T)>
190 struct TupleElement<true, 9, GTEST_10_TUPLE_(T) > {
200 tuple(const tuple& /* t */) {}
201 tuple& operator=(const tuple& /* t */) { return *this; }
204 template <GTEST_1_TYPENAMES_(T)>
205 class GTEST_1_TUPLE_(T) {
213 tuple(const tuple& t) : f0_(t.f0_) {}
216 tuple(const GTEST_1_TUPLE_(U)& t) : f0_(t.f0_) {}
218 tuple& operator=(const tuple& t) { return CopyFrom(t); }
221 tuple& operator=(const GTEST_1_TUPLE_(U)& t) {
222 return CopyFrom(t);
228 tuple& CopyFrom(const GTEST_1_TUPLE_(U)& t) {
229 f0_ = t.f0_;
236 template <GTEST_2_TYPENAMES_(T)>
237 class GTEST_2_TUPLE_(T) {
246 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_) {}
249 tuple(const GTEST_2_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_) {}
253 tuple& operator=(const tuple& t) { return CopyFrom(t); }
256 tuple& operator=(const GTEST_2_TUPLE_(U)& t) {
257 return CopyFrom(t);
269 tuple& CopyFrom(const GTEST_2_TUPLE_(U)& t) {
270 f0_ = t.f0_;
271 f1_ = t.f1_;
279 template <GTEST_3_TYPENAMES_(T)>
280 class GTEST_3_TUPLE_(T) {
289 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
292 tuple(const GTEST_3_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_) {}
294 tuple& operator=(const tuple& t) { return CopyFrom(t); }
297 tuple& operator=(const GTEST_3_TUPLE_(U)& t) {
298 return CopyFrom(t);
304 tuple& CopyFrom(const GTEST_3_TUPLE_(U)& t) {
305 f0_ = t.f0_;
306 f1_ = t.f1_;
307 f2_ = t.f2_;
316 template <GTEST_4_TYPENAMES_(T)>
317 class GTEST_4_TUPLE_(T) {
327 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_) {}
330 tuple(const GTEST_4_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
331 f3_(t.f3_) {}
333 tuple& operator=(const tuple& t) { return CopyFrom(t); }
336 tuple& operator=(const GTEST_4_TUPLE_(U)& t) {
337 return CopyFrom(t);
343 tuple& CopyFrom(const GTEST_4_TUPLE_(U)& t) {
344 f0_ = t.f0_;
345 f1_ = t.f1_;
346 f2_ = t.f2_;
347 f3_ = t.f3_;
357 template <GTEST_5_TYPENAMES_(T)>
358 class GTEST_5_TUPLE_(T) {
368 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
369 f4_(t.f4_) {}
372 tuple(const GTEST_5_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
373 f3_(t.f3_), f4_(t.f4_) {}
375 tuple& operator=(const tuple& t) { return CopyFrom(t); }
378 tuple& operator=(const GTEST_5_TUPLE_(U)& t) {
379 return CopyFrom(t);
385 tuple& CopyFrom(const GTEST_5_TUPLE_(U)& t) {
386 f0_ = t.f0_;
387 f1_ = t.f1_;
388 f2_ = t.f2_;
389 f3_ = t.f3_;
390 f4_ = t.f4_;
401 template <GTEST_6_TYPENAMES_(T)>
402 class GTEST_6_TUPLE_(T) {
413 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
414 f4_(t.f4_), f5_(t.f5_) {}
417 tuple(const GTEST_6_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
418 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_) {}
420 tuple& operator=(const tuple& t) { return CopyFrom(t); }
423 tuple& operator=(const GTEST_6_TUPLE_(U)& t) {
424 return CopyFrom(t);
430 tuple& CopyFrom(const GTEST_6_TUPLE_(U)& t) {
431 f0_ = t.f0_;
432 f1_ = t.f1_;
433 f2_ = t.f2_;
434 f3_ = t.f3_;
435 f4_ = t.f4_;
436 f5_ = t.f5_;
448 template <GTEST_7_TYPENAMES_(T)>
449 class GTEST_7_TUPLE_(T) {
460 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
461 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
464 tuple(const GTEST_7_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
465 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_) {}
467 tuple& operator=(const tuple& t) { return CopyFrom(t); }
470 tuple& operator=(const GTEST_7_TUPLE_(U)& t) {
471 return CopyFrom(t);
477 tuple& CopyFrom(const GTEST_7_TUPLE_(U)& t) {
478 f0_ = t.f0_;
479 f1_ = t.f1_;
480 f2_ = t.f2_;
481 f3_ = t.f3_;
482 f4_ = t.f4_;
483 f5_ = t.f5_;
484 f6_ = t.f6_;
497 template <GTEST_8_TYPENAMES_(T)>
498 class GTEST_8_TUPLE_(T) {
510 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
511 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
514 tuple(const GTEST_8_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
515 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_) {}
517 tuple& operator=(const tuple& t) { return CopyFrom(t); }
520 tuple& operator=(const GTEST_8_TUPLE_(U)& t) {
521 return CopyFrom(t);
527 tuple& CopyFrom(const GTEST_8_TUPLE_(U)& t) {
528 f0_ = t.f0_;
529 f1_ = t.f1_;
530 f2_ = t.f2_;
531 f3_ = t.f3_;
532 f4_ = t.f4_;
533 f5_ = t.f5_;
534 f6_ = t.f6_;
535 f7_ = t.f7_;
549 template <GTEST_9_TYPENAMES_(T)>
550 class GTEST_9_TUPLE_(T) {
562 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
563 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
566 tuple(const GTEST_9_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
567 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_) {}
569 tuple& operator=(const tuple& t) { return CopyFrom(t); }
572 tuple& operator=(const GTEST_9_TUPLE_(U)& t) {
573 return CopyFrom(t);
579 tuple& CopyFrom(const GTEST_9_TUPLE_(U)& t) {
580 f0_ = t.f0_;
581 f1_ = t.f1_;
582 f2_ = t.f2_;
583 f3_ = t.f3_;
584 f4_ = t.f4_;
585 f5_ = t.f5_;
586 f6_ = t.f6_;
587 f7_ = t.f7_;
588 f8_ = t.f8_;
603 template <GTEST_10_TYPENAMES_(T)>
617 tuple(const tuple& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_), f3_(t.f3_),
618 f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_), f9_(t.f9_) {}
621 tuple(const GTEST_10_TUPLE_(U)& t) : f0_(t.f0_), f1_(t.f1_), f2_(t.f2_),
622 f3_(t.f3_), f4_(t.f4_), f5_(t.f5_), f6_(t.f6_), f7_(t.f7_), f8_(t.f8_),
623 f9_(t.f9_) {}
625 tuple& operator=(const tuple& t) { return CopyFrom(t); }
628 tuple& operator=(const GTEST_10_TUPLE_(U)& t) {
629 return CopyFrom(t);
635 tuple& CopyFrom(const GTEST_10_TUPLE_(U)& t) {
636 f0_ = t.f0_;
637 f1_ = t.f1_;
638 f2_ = t.f2_;
639 f3_ = t.f3_;
640 f4_ = t.f4_;
641 f5_ = t.f5_;
642 f6_ = t.f6_;
643 f7_ = t.f7_;
644 f8_ = t.f8_;
645 f9_ = t.f9_;
663 // Known limitations: we don't support passing an
664 // std::tr1::reference_wrapper<T> to make_tuple(). And we don't
669 template <GTEST_1_TYPENAMES_(T)>
670 inline GTEST_1_TUPLE_(T) make_tuple(const T0& f0) {
671 return GTEST_1_TUPLE_(T)(f0);
674 template <GTEST_2_TYPENAMES_(T)>
675 inline GTEST_2_TUPLE_(T) make_tuple(const T0& f0, const T1& f1) {
676 return GTEST_2_TUPLE_(T)(f0, f1);
679 template <GTEST_3_TYPENAMES_(T)>
680 inline GTEST_3_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2) {
681 return GTEST_3_TUPLE_(T)(f0, f1, f2);
684 template <GTEST_4_TYPENAMES_(T)>
685 inline GTEST_4_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
687 return GTEST_4_TUPLE_(T)(f0, f1, f2, f3);
690 template <GTEST_5_TYPENAMES_(T)>
691 inline GTEST_5_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
693 return GTEST_5_TUPLE_(T)(f0, f1, f2, f3, f4);
696 template <GTEST_6_TYPENAMES_(T)>
697 inline GTEST_6_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
699 return GTEST_6_TUPLE_(T)(f0, f1, f2, f3, f4, f5);
702 template <GTEST_7_TYPENAMES_(T)>
703 inline GTEST_7_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
705 return GTEST_7_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6);
708 template <GTEST_8_TYPENAMES_(T)>
709 inline GTEST_8_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
711 return GTEST_8_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7);
714 template <GTEST_9_TYPENAMES_(T)>
715 inline GTEST_9_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
718 return GTEST_9_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8);
721 template <GTEST_10_TYPENAMES_(T)>
722 inline GTEST_10_TUPLE_(T) make_tuple(const T0& f0, const T1& f1, const T2& f2,
725 return GTEST_10_TUPLE_(T)(f0, f1, f2, f3, f4, f5, f6, f7, f8, f9);
732 template <GTEST_0_TYPENAMES_(T)>
733 struct tuple_size<GTEST_0_TUPLE_(T) > {
737 template <GTEST_1_TYPENAMES_(T)>
738 struct tuple_size<GTEST_1_TUPLE_(T) > {
742 template <GTEST_2_TYPENAMES_(T)>
743 struct tuple_size<GTEST_2_TUPLE_(T) > {
747 template <GTEST_3_TYPENAMES_(T)>
748 struct tuple_size<GTEST_3_TUPLE_(T) > {
752 template <GTEST_4_TYPENAMES_(T)>
753 struct tuple_size<GTEST_4_TUPLE_(T) > {
757 template <GTEST_5_TYPENAMES_(T)>
758 struct tuple_size<GTEST_5_TUPLE_(T) > {
762 template <GTEST_6_TYPENAMES_(T)>
763 struct tuple_size<GTEST_6_TUPLE_(T) > {
767 template <GTEST_7_TYPENAMES_(T)>
768 struct tuple_size<GTEST_7_TUPLE_(T) > {
772 template <GTEST_8_TYPENAMES_(T)>
773 struct tuple_size<GTEST_8_TUPLE_(T) > {
777 template <GTEST_9_TYPENAMES_(T)>
778 struct tuple_size<GTEST_9_TUPLE_(T) > {
782 template <GTEST_10_TYPENAMES_(T)>
783 struct tuple_size<GTEST_10_TUPLE_(T) > {
804 Field(Tuple& t) { return t.f0_; } // NOLINT
808 ConstField(const Tuple& t) { return t.f0_; }
816 Field(Tuple& t) { return t.f1_; } // NOLINT
820 ConstField(const Tuple& t) { return t.f1_; }
828 Field(Tuple& t) { return t.f2_; } // NOLINT
832 ConstField(const Tuple& t) { return t.f2_; }
840 Field(Tuple& t) { return t.f3_; } // NOLINT
844 ConstField(const Tuple& t) { return t.f3_; }
852 Field(Tuple& t) { return t.f4_; } // NOLINT
856 ConstField(const Tuple& t) { return t.f4_; }
864 Field(Tuple& t) { return t.f5_; } // NOLINT
868 ConstField(const Tuple& t) { return t.f5_; }
876 Field(Tuple& t) { return t.f6_; } // NOLINT
880 ConstField(const Tuple& t) { return t.f6_; }
888 Field(Tuple& t) { return t.f7_; } // NOLINT
892 ConstField(const Tuple& t) { return t.f7_; }
900 Field(Tuple& t) { return t.f8_; } // NOLINT
904 ConstField(const Tuple& t) { return t.f8_; }
912 Field(Tuple& t) { return t.f9_; } // NOLINT
916 ConstField(const Tuple& t) { return t.f9_; }
921 template <int k, GTEST_10_TYPENAMES_(T)>
922 GTEST_ADD_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
923 get(GTEST_10_TUPLE_(T)& t) {
924 return gtest_internal::Get<k>::Field(t);
927 template <int k, GTEST_10_TYPENAMES_(T)>
928 GTEST_BY_REF_(GTEST_TUPLE_ELEMENT_(k, GTEST_10_TUPLE_(T)))
929 get(const GTEST_10_TUPLE_(T)& t) {
930 return gtest_internal::Get<k>::ConstField(t);
935 // We only implement == and !=, as we don't have a need for the rest yet.
965 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
966 inline bool operator==(const GTEST_10_TUPLE_(T)& t,
969 tuple_size<GTEST_10_TUPLE_(T) >::value,
970 tuple_size<GTEST_10_TUPLE_(U) >::value>::Eq(t, u);
973 template <GTEST_10_TYPENAMES_(T), GTEST_10_TYPENAMES_(U)>
974 inline bool operator!=(const GTEST_10_TUPLE_(T)& t,
975 const GTEST_10_TUPLE_(U)& u) { return !(t == u); }