Repository: google/googletest
File: googletest/include/gtest/gtest-printers.h (C/C++)

Code before:

typedef ::std::vector< ::std::string> Strings;

// TuplePolicy<TupleT> must provide:
// - tuple_size
//     size of tuple TupleT.
// - get<size_t I>(const TupleT& t)
//     static function extracting element I of tuple TupleT.
// - tuple_element<size_t I>::type
//     type of element I of tuple TupleT.
template <typename TupleT>
struct TuplePolicy;

#if GTEST_HAS_TR1_TUPLE
template <typename TupleT>
struct TuplePolicy {
  typedef TupleT Tuple;
  static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;

  template <size_t I>
  struct tuple_element : ::std::tr1::tuple_element<static_cast<int>(I), Tuple> {
  };

  template <size_t I>
  static typename AddReference<const typename ::std::tr1::tuple_element<
      I, Tuple>::type>::type
  get(const Tuple& tuple) {
    return ::std::tr1::get<I>(tuple);
  }
};
template <typename TupleT>
const size_t TuplePolicy<TupleT>::tuple_size;
#endif  // GTEST_HAS_TR1_TUPLE

#if GTEST_HAS_STD_TUPLE_
template <typename... Types>
struct TuplePolicy< ::std::tuple<Types...> > {
  typedef ::std::tuple<Types...> Tuple;
  static const size_t tuple_size = ::std::tuple_size<Tuple>::value;

  template <size_t I>
  struct tuple_element : ::std::tuple_element<I, Tuple> {};

  template <size_t I>
  static const typename ::std::tuple_element<I, Tuple>::type& get(
      const Tuple& tuple) {
    return ::std::get<I>(tuple);
  }
};
template <typename... Types>
const size_t TuplePolicy< ::std::tuple<Types...> >::tuple_size;

Review comment (suggestion):
As I explained in https://github.com/google/googletest/pull/1815 - that change was made for a reason. We can not just roll it back. You may want to consider using macros to only do this when this version of MSVC is used .

Code after:

typedef ::std::vector< ::std::string> Strings;

// TuplePolicy<TupleT> must provide:
// - tuple_size
//     size of tuple TupleT.
// - get<size_t I>(const TupleT& t)
//     static function extracting element I of tuple TupleT.
// - tuple_element<size_t I>::type
//     type of element I of tuple TupleT.
template <typename TupleT>
struct TuplePolicy;

#if GTEST_HAS_TR1_TUPLE
template <typename TupleT>
struct TuplePolicy {
  typedef TupleT Tuple;
  static const size_t tuple_size = ::std::tr1::tuple_size<Tuple>::value;

  template <size_t I>
  struct tuple_element : ::std::tr1::tuple_element<static_cast<int>(I), Tuple> {
  };

  template <size_t I>
  static typename AddReference<const typename ::std::tr1::tuple_element<
#if defined(_MSC_VER) && _MSC_VER < 1900
      I, Tuple>::type>::type
#else
      static_cast<int>(I), Tuple>::type>::type
#endif
  get(const Tuple& tuple) {
    return ::std::tr1::get<I>(tuple);
  }
};
template <typename TupleT>
const size_t TuplePolicy<TupleT>::tuple_size;
#endif  // GTEST_HAS_TR1_TUPLE

#if GTEST_HAS_STD_TUPLE_
template <typename... Types>
struct TuplePolicy< ::std::tuple<Types...> > {
  typedef ::std::tuple<Types...> Tuple;
  static const size_t tuple_size = ::std::tuple_size<Tuple>::value;

  template <size_t I>
  struct tuple_element : ::std::tuple_element<I, Tuple> {};

  template <size_t I>
  static const typename ::std::tuple_element<I, Tuple>::type& get(
      const Tuple& tuple) {
    return ::std::get<I>(tuple);