Home | History | Annotate | Download | only in gtest

Lines Matching defs:Tuple

76 //   // Prints the fields of a tuple tersely to a string vector, one
77 // // element for each field. Tuple support must be enabled in
80 // const Tuple& value);
107 # include <tuple>
602 // Helper function for printing a tuple. T must be instantiated with
603 // a tuple type.
609 // Overload for ::std::tr1::tuple. Needed for printing function arguments,
614 // regardless of whether tr1::tuple is implemented using the
617 inline void PrintTo(const ::std::tr1::tuple<>& t, ::std::ostream* os) {
622 void PrintTo(const ::std::tr1::tuple<T1>& t, ::std::ostream* os) {
627 void PrintTo(const ::std::tr1::tuple<T1, T2>& t, ::std::ostream* os) {
632 void PrintTo(const ::std::tr1::tuple<T1, T2, T3>& t, ::std::ostream* os) {
637 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4>& t, ::std::ostream* os) {
642 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5>& t,
649 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6>& t,
656 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7>& t,
663 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8>& t,
670 void PrintTo(const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9>& t,
678 const ::std::tr1::tuple<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>& t,
686 void PrintTo(const ::std::tuple<Types...>& t, ::std::ostream* os) {
880 // size of tuple TupleT.
882 // static function extracting element I of tuple TupleT.
884 // type of element I of tuple TupleT.
891 typedef TupleT Tuple;
892 static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;
895 struct tuple_element : ::std::tr1::tuple_element<I, Tuple> {};
899 const typename ::std::tr1::tuple_element<I, Tuple>::type>::type get(
900 const Tuple& tuple) {
901 return ::std::tr1::get<I>(tuple);
910 struct TuplePolicy< ::std::tuple<Types...> > {
911 typedef ::std::tuple<Types...> Tuple;
912 static const size_t tuple_size = ::std::tuple_size<Tuple>::value;
915 struct tuple_element : ::std::tuple_element<I, Tuple> {};
918 static const typename ::std::tuple_element<I, Tuple>::type& get(
919 const Tuple& tuple) {
920 return ::std::get<I>(tuple);
924 const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;
930 // induction on the number of tuple fields. The idea is that
932 // fields in tuple t, and can be defined in terms of
938 // Prints the first N fields of a tuple.
939 template <typename Tuple>
940 static void PrintPrefixTo(const Tuple& t, ::std::ostream* os) {
948 typename TuplePolicy<Tuple>::template tuple_element<N - 1>::type>
949 ::Print(TuplePolicy<Tuple>::template get<N - 1>(t), os);
952 // Tersely prints the first N fields of a tuple to a string vector,
954 template <typename Tuple>
955 static void TersePrintPrefixToStrings(const Tuple& t, Strings* strings) {
958 UniversalTersePrint(TuplePolicy<Tuple>::template get<N - 1>(t), &ss);
966 template <typename Tuple>
967 static void PrintPrefixTo(const Tuple&, ::std::ostream*) {}
969 template <typename Tuple>
970 static void TersePrintPrefixToStrings(const Tuple&, Strings*) {}
973 // Helper function for printing a tuple.
974 // Tuple must be either std::tr1::tuple or std::tuple type.
975 template <typename Tuple>
976 void PrintTupleTo(const Tuple& t, ::std::ostream* os) {
978 TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::PrintPrefixTo(t, os);
982 // Prints the fields of a tuple tersely to a string vector, one
985 template <typename Tuple>
986 Strings UniversalTersePrintTupleFieldsToStrings(const Tuple& value) {
988 TuplePrefixPrinter<TuplePolicy<Tuple>::tuple_size>::