From bd0188320de5aab1b09718e2c466387099d43cfb Mon Sep 17 00:00:00 2001 From: kosak Date: Wed, 2 Apr 2014 20:30:00 +0000 Subject: [PATCH] Export tuple and friends in the ::testing namespace. --- include/gmock/gmock-actions.h | 4 +- include/gmock/gmock-generated-actions.h | 257 ++++++++---------- include/gmock/gmock-generated-actions.h.pump | 33 +-- .../gmock/gmock-generated-function-mockers.h | 43 ++- .../gmock-generated-function-mockers.h.pump | 4 +- include/gmock/gmock-generated-matchers.h | 145 +++++----- include/gmock/gmock-generated-matchers.h.pump | 18 +- include/gmock/gmock-matchers.h | 28 +- include/gmock/gmock-more-actions.h | 16 +- .../internal/gmock-generated-internal-utils.h | 66 ++--- .../gmock-generated-internal-utils.h.pump | 8 +- include/gmock/internal/gmock-internal-utils.h | 8 +- test/gmock-actions_test.cc | 8 +- test/gmock-generated-actions_test.cc | 12 +- test/gmock-generated-internal-utils_test.cc | 2 +- test/gmock-generated-matchers_test.cc | 10 +- test/gmock-internal-utils_test.cc | 3 - test/gmock-matchers_test.cc | 8 +- test/gmock-more-actions_test.cc | 8 +- 19 files changed, 306 insertions(+), 375 deletions(-) diff --git a/include/gmock/gmock-actions.h b/include/gmock/gmock-actions.h index d08152a8..83143510 100644 --- a/include/gmock/gmock-actions.h +++ b/include/gmock/gmock-actions.h @@ -728,7 +728,7 @@ class SetArgumentPointeeAction { template void Perform(const ArgumentTuple& args) const { CompileAssertTypesEqual(); - *::std::tr1::get(args) = value_; + *::testing::get(args) = value_; } private: @@ -751,7 +751,7 @@ class SetArgumentPointeeAction { template void Perform(const ArgumentTuple& args) const { CompileAssertTypesEqual(); - ::std::tr1::get(args)->CopyFrom(*proto_); + ::testing::get(args)->CopyFrom(*proto_); } private: diff --git a/include/gmock/gmock-generated-actions.h b/include/gmock/gmock-generated-actions.h index 2327393d..f511bc8b 100644 --- a/include/gmock/gmock-generated-actions.h +++ b/include/gmock/gmock-generated-actions.h @@ -51,234 +51,219 @@ template class InvokeHelper; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::std::tr1::tuple<>&) { - return function(); + static R Invoke(Function function, const ::testing::tuple<>&) { + return function(); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::std::tr1::tuple<>&) { - return (obj_ptr->*method_ptr)(); + const ::testing::tuple<>&) { + return (obj_ptr->*method_ptr)(); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return function(get<0>(args)); + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return (obj_ptr->*method_ptr)(get<0>(args)); + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args)); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return function(get<0>(args), get<1>(args)); + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args)); + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args)); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return function(get<0>(args), get<1>(args), get<2>(args)); + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args)); + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args)); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args)); + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), - get<3>(args)); + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args)); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args), - get<4>(args)); + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args), get<4>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args)); + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args), get<4>(args)); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args), - get<4>(args), get<5>(args)); + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args), get<4>(args), get<5>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args), get<5>(args)); + const ::testing::tuple& args) { + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args), get<4>(args), get<5>(args)); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args), - get<4>(args), get<5>(args), get<6>(args)); + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args), get<4>(args), get<5>(args), get<6>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args), get<5>(args), get<6>(args)); + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args), get<4>(args), get<5>(args), + get<6>(args)); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args), - get<4>(args), get<5>(args), get<6>(args), get<7>(args)); + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args), get<4>(args), get<5>(args), get<6>(args), + get<7>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args)); + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args), get<4>(args), get<5>(args), + get<6>(args), get<7>(args)); } }; template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args), - get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args)); + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args), get<4>(args), get<5>(args), get<6>(args), + get<7>(args), get<8>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args), - get<8>(args)); + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args), get<4>(args), get<5>(args), + get<6>(args), get<7>(args), get<8>(args)); } }; template -class InvokeHelper > { public: template - static R Invoke(Function function, const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return function(get<0>(args), get<1>(args), get<2>(args), get<3>(args), - get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args), - get<9>(args)); + static R Invoke(Function function, const ::testing::tuple& args) { + return function(get<0>(args), get<1>(args), get<2>(args), + get<3>(args), get<4>(args), get<5>(args), get<6>(args), + get<7>(args), get<8>(args), get<9>(args)); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::std::tr1::tuple& args) { - using ::std::tr1::get; - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args), - get<8>(args), get<9>(args)); + return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), + get<2>(args), get<3>(args), get<4>(args), get<5>(args), + get<6>(args), get<7>(args), get<8>(args), get<9>(args)); } }; @@ -386,21 +371,21 @@ class CallableHelper { // An INTERNAL macro for extracting the type of a tuple field. It's // subject to change without notice - DO NOT USE IN USER CODE! #define GMOCK_FIELD_(Tuple, N) \ - typename ::std::tr1::tuple_element::type + typename ::testing::tuple_element::type // SelectArgs::type is the // type of an n-ary function whose i-th (1-based) argument type is the // k{i}-th (0-based) field of ArgumentTuple, which must be a tuple // type, and whose return type is Result. For example, -// SelectArgs, 0, 3>::type +// SelectArgs, 0, 3>::type // is int(bool, long). // // SelectArgs::Select(args) // returns the selected fields (k1, k2, ..., k_n) of args as a tuple. // For example, -// SelectArgs, 2, 0>::Select( -// ::std::tr1::make_tuple(true, 'a', 2.5)) -// returns ::std::tr1::tuple (2.5, true). +// SelectArgs, 2, 0>::Select( +// ::testing::make_tuple(true, 'a', 2.5)) +// returns tuple (2.5, true). // // The numbers in list k1, k2, ..., k_n must be >= 0, where n can be // in the range [0, 10]. Duplicates are allowed and they don't have @@ -418,7 +403,6 @@ class SelectArgs { GMOCK_FIELD_(ArgumentTuple, k10)); typedef typename Function::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - using ::std::tr1::get; return SelectedArgs(get(args), get(args), get(args), get(args), get(args), get(args), get(args), get(args), get(args), get(args)); @@ -432,7 +416,6 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& /* args */) { - using ::std::tr1::get; return SelectedArgs(); } }; @@ -444,7 +427,6 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - using ::std::tr1::get; return SelectedArgs(get(args)); } }; @@ -457,7 +439,6 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - using ::std::tr1::get; return SelectedArgs(get(args), get(args)); } }; @@ -470,7 +451,6 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - using ::std::tr1::get; return SelectedArgs(get(args), get(args), get(args)); } }; @@ -485,7 +465,6 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - using ::std::tr1::get; return SelectedArgs(get(args), get(args), get(args), get(args)); } @@ -501,7 +480,6 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - using ::std::tr1::get; return SelectedArgs(get(args), get(args), get(args), get(args), get(args)); } @@ -518,7 +496,6 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - using ::std::tr1::get; return SelectedArgs(get(args), get(args), get(args), get(args), get(args), get(args)); } @@ -535,7 +512,6 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - using ::std::tr1::get; return SelectedArgs(get(args), get(args), get(args), get(args), get(args), get(args), get(args)); } @@ -553,7 +529,6 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - using ::std::tr1::get; return SelectedArgs(get(args), get(args), get(args), get(args), get(args), get(args), get(args), get(args)); @@ -572,7 +547,6 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - using ::std::tr1::get; return SelectedArgs(get(args), get(args), get(args), get(args), get(args), get(args), get(args), get(args), get(args)); @@ -638,8 +612,7 @@ struct ExcessiveArg {}; template class ActionHelper { public: - static Result Perform(Impl* impl, const ::std::tr1::tuple<>& args) { - using ::std::tr1::get; + static Result Perform(Impl* impl, const ::testing::tuple<>& args) { return impl->template gmock_PerformImpl<>(args, ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), @@ -647,8 +620,7 @@ class ActionHelper { } template - static Result Perform(Impl* impl, const ::std::tr1::tuple& args) { - using ::std::tr1::get; + static Result Perform(Impl* impl, const ::testing::tuple& args) { return impl->template gmock_PerformImpl(args, get<0>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), @@ -656,8 +628,7 @@ class ActionHelper { } template - static Result Perform(Impl* impl, const ::std::tr1::tuple& args) { - using ::std::tr1::get; + static Result Perform(Impl* impl, const ::testing::tuple& args) { return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), @@ -665,8 +636,7 @@ class ActionHelper { } template - static Result Perform(Impl* impl, const ::std::tr1::tuple& args) { - using ::std::tr1::get; + static Result Perform(Impl* impl, const ::testing::tuple& args) { return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), @@ -674,9 +644,8 @@ class ActionHelper { } template - static Result Perform(Impl* impl, const ::std::tr1::tuple& args) { - using ::std::tr1::get; return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), @@ -684,9 +653,8 @@ class ActionHelper { } template - static Result Perform(Impl* impl, const ::std::tr1::tuple& args) { - using ::std::tr1::get; return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), @@ -695,9 +663,8 @@ class ActionHelper { template - static Result Perform(Impl* impl, const ::std::tr1::tuple& args) { - using ::std::tr1::get; return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), @@ -706,9 +673,8 @@ class ActionHelper { template - static Result Perform(Impl* impl, const ::std::tr1::tuple& args) { - using ::std::tr1::get; return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(), @@ -717,9 +683,8 @@ class ActionHelper { template - static Result Perform(Impl* impl, const ::std::tr1::tuple& args) { - using ::std::tr1::get; return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args), ExcessiveArg(), @@ -728,9 +693,8 @@ class ActionHelper { template - static Result Perform(Impl* impl, const ::std::tr1::tuple& args) { - using ::std::tr1::get; return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args), @@ -739,9 +703,8 @@ class ActionHelper { template - static Result Perform(Impl* impl, const ::std::tr1::tuple& args) { - using ::std::tr1::get; return impl->template gmock_PerformImpl(args, get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), get<5>(args), get<6>(args), get<7>(args), get<8>(args), @@ -1053,7 +1016,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, // ACTION_TEMPLATE(DuplicateArg, // HAS_2_TEMPLATE_PARAMS(int, k, typename, T), // AND_1_VALUE_PARAMS(output)) { -// *output = T(std::tr1::get(args)); +// *output = T(::testing::get(args)); // } // ... // int n; @@ -2262,77 +2225,77 @@ ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_0_VALUE_PARAMS()) { return internal::CallableHelper::Call( - ::std::tr1::get(args)); + ::testing::get(args)); } ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_1_VALUE_PARAMS(p0)) { return internal::CallableHelper::Call( - ::std::tr1::get(args), p0); + ::testing::get(args), p0); } ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_2_VALUE_PARAMS(p0, p1)) { return internal::CallableHelper::Call( - ::std::tr1::get(args), p0, p1); + ::testing::get(args), p0, p1); } ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_3_VALUE_PARAMS(p0, p1, p2)) { return internal::CallableHelper::Call( - ::std::tr1::get(args), p0, p1, p2); + ::testing::get(args), p0, p1, p2); } ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_4_VALUE_PARAMS(p0, p1, p2, p3)) { return internal::CallableHelper::Call( - ::std::tr1::get(args), p0, p1, p2, p3); + ::testing::get(args), p0, p1, p2, p3); } ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)) { return internal::CallableHelper::Call( - ::std::tr1::get(args), p0, p1, p2, p3, p4); + ::testing::get(args), p0, p1, p2, p3, p4); } ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)) { return internal::CallableHelper::Call( - ::std::tr1::get(args), p0, p1, p2, p3, p4, p5); + ::testing::get(args), p0, p1, p2, p3, p4, p5); } ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)) { return internal::CallableHelper::Call( - ::std::tr1::get(args), p0, p1, p2, p3, p4, p5, p6); + ::testing::get(args), p0, p1, p2, p3, p4, p5, p6); } ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)) { return internal::CallableHelper::Call( - ::std::tr1::get(args), p0, p1, p2, p3, p4, p5, p6, p7); + ::testing::get(args), p0, p1, p2, p3, p4, p5, p6, p7); } ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8)) { return internal::CallableHelper::Call( - ::std::tr1::get(args), p0, p1, p2, p3, p4, p5, p6, p7, p8); + ::testing::get(args), p0, p1, p2, p3, p4, p5, p6, p7, p8); } ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)) { return internal::CallableHelper::Call( - ::std::tr1::get(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); + ::testing::get(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); } // Various overloads for ReturnNew(). diff --git a/include/gmock/gmock-generated-actions.h.pump b/include/gmock/gmock-generated-actions.h.pump index 8e2b5735..9fba5988 100644 --- a/include/gmock/gmock-generated-actions.h.pump +++ b/include/gmock/gmock-generated-actions.h.pump @@ -61,24 +61,20 @@ $range j 1..i $var types = [[$for j [[, typename A$j]]]] $var as = [[$for j, [[A$j]]]] $var args = [[$if i==0 [[]] $else [[ args]]]] -$var import = [[$if i==0 [[]] $else [[ - using ::std::tr1::get; - -]]]] $var gets = [[$for j, [[get<$(j - 1)>(args)]]]] template -class InvokeHelper > { +class InvokeHelper > { public: template - static R Invoke(Function function, const ::std::tr1::tuple<$as>&$args) { -$import return function($gets); + static R Invoke(Function function, const ::testing::tuple<$as>&$args) { + return function($gets); } template static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::std::tr1::tuple<$as>&$args) { -$import return (obj_ptr->*method_ptr)($gets); + const ::testing::tuple<$as>&$args) { + return (obj_ptr->*method_ptr)($gets); } }; @@ -141,7 +137,7 @@ $var Ts = [[$for j, [[T$j]]]] // An INTERNAL macro for extracting the type of a tuple field. It's // subject to change without notice - DO NOT USE IN USER CODE! #define GMOCK_FIELD_(Tuple, N) \ - typename ::std::tr1::tuple_element::type + typename ::testing::tuple_element::type $range i 1..n @@ -149,15 +145,15 @@ $range i 1..n // type of an n-ary function whose i-th (1-based) argument type is the // k{i}-th (0-based) field of ArgumentTuple, which must be a tuple // type, and whose return type is Result. For example, -// SelectArgs, 0, 3>::type +// SelectArgs, 0, 3>::type // is int(bool, long). // // SelectArgs::Select(args) // returns the selected fields (k1, k2, ..., k_n) of args as a tuple. // For example, -// SelectArgs, 2, 0>::Select( -// ::std::tr1::make_tuple(true, 'a', 2.5)) -// returns ::std::tr1::tuple (2.5, true). +// SelectArgs, 2, 0>::Select( +// ::testing::make_tuple(true, 'a', 2.5)) +// returns tuple (2.5, true). // // The numbers in list k1, k2, ..., k_n must be >= 0, where n can be // in the range [0, $n]. Duplicates are allowed and they don't have @@ -169,7 +165,6 @@ class SelectArgs { typedef Result type($for i, [[GMOCK_FIELD_(ArgumentTuple, k$i)]]); typedef typename Function::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - using ::std::tr1::get; return SelectedArgs($for i, [[get(args)]]); } }; @@ -186,7 +181,6 @@ class SelectArgs::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& [[]] $if i == 1 [[/* args */]] $else [[args]]) { - using ::std::tr1::get; return SelectedArgs($for j1, [[get(args)]]); } }; @@ -266,8 +260,7 @@ $range k 1..n-i $var eas = [[$for k, [[ExcessiveArg()]]]] $var arg_list = [[$if (i==0) | (i==n) [[$as$eas]] $else [[$as, $eas]]]] $template - static Result Perform(Impl* impl, const ::std::tr1::tuple<$As>& args) { - using ::std::tr1::get; + static Result Perform(Impl* impl, const ::testing::tuple<$As>& args) { return impl->template gmock_PerformImpl<$As>(args, $arg_list); } @@ -454,7 +447,7 @@ $for k [[, \ // ACTION_TEMPLATE(DuplicateArg, // HAS_2_TEMPLATE_PARAMS(int, k, typename, T), // AND_1_VALUE_PARAMS(output)) { -// *output = T(std::tr1::get(args)); +// *output = T(::testing::get(args)); // } // ... // int n; @@ -789,7 +782,7 @@ ACTION_TEMPLATE(InvokeArgument, HAS_1_TEMPLATE_PARAMS(int, k), AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])) { return internal::CallableHelper::Call( - ::std::tr1::get(args)$for j [[, p$j]]); + ::testing::get(args)$for j [[, p$j]]); } ]] diff --git a/include/gmock/gmock-generated-function-mockers.h b/include/gmock/gmock-generated-function-mockers.h index 577fd9e9..1b01dc86 100644 --- a/include/gmock/gmock-generated-function-mockers.h +++ b/include/gmock/gmock-generated-function-mockers.h @@ -85,7 +85,7 @@ class FunctionMocker : public typedef typename internal::Function::ArgumentTuple ArgumentTuple; MockSpec& With(const Matcher& m1) { - this->current_spec().SetMatchers(::std::tr1::make_tuple(m1)); + this->current_spec().SetMatchers(::testing::make_tuple(m1)); return this->current_spec(); } @@ -106,7 +106,7 @@ class FunctionMocker : public typedef typename internal::Function::ArgumentTuple ArgumentTuple; MockSpec& With(const Matcher& m1, const Matcher& m2) { - this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2)); + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2)); return this->current_spec(); } @@ -128,7 +128,7 @@ class FunctionMocker : public MockSpec& With(const Matcher& m1, const Matcher& m2, const Matcher& m3) { - this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3)); + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3)); return this->current_spec(); } @@ -150,7 +150,7 @@ class FunctionMocker : public MockSpec& With(const Matcher& m1, const Matcher& m2, const Matcher& m3, const Matcher& m4) { - this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4)); + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4)); return this->current_spec(); } @@ -173,8 +173,7 @@ class FunctionMocker : public MockSpec& With(const Matcher& m1, const Matcher& m2, const Matcher& m3, const Matcher& m4, const Matcher& m5) { - this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, - m5)); + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5)); return this->current_spec(); } @@ -198,7 +197,7 @@ class FunctionMocker : public MockSpec& With(const Matcher& m1, const Matcher& m2, const Matcher& m3, const Matcher& m4, const Matcher& m5, const Matcher& m6) { - this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5, + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5, m6)); return this->current_spec(); } @@ -223,7 +222,7 @@ class FunctionMocker : public MockSpec& With(const Matcher& m1, const Matcher& m2, const Matcher& m3, const Matcher& m4, const Matcher& m5, const Matcher& m6, const Matcher& m7) { - this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5, + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7)); return this->current_spec(); } @@ -248,7 +247,7 @@ class FunctionMocker : public MockSpec& With(const Matcher& m1, const Matcher& m2, const Matcher& m3, const Matcher& m4, const Matcher& m5, const Matcher& m6, const Matcher& m7, const Matcher& m8) { - this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5, + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7, m8)); return this->current_spec(); } @@ -274,7 +273,7 @@ class FunctionMocker : public const Matcher& m3, const Matcher& m4, const Matcher& m5, const Matcher& m6, const Matcher& m7, const Matcher& m8, const Matcher& m9) { - this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5, + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7, m8, m9)); return this->current_spec(); } @@ -301,7 +300,7 @@ class FunctionMocker : public const Matcher& m3, const Matcher& m4, const Matcher& m5, const Matcher& m6, const Matcher& m7, const Matcher& m8, const Matcher& m9, const Matcher& m10) { - this->current_spec().SetMatchers(::std::tr1::make_tuple(m1, m2, m3, m4, m5, + this->current_spec().SetMatchers(::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7, m8, m9, m10)); return this->current_spec(); } @@ -353,7 +352,7 @@ using internal::FunctionMocker; #define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ ) constness { \ - GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ == 0), \ this_method_does_not_take_0_arguments); \ @@ -372,7 +371,7 @@ using internal::FunctionMocker; #define GMOCK_METHOD1_(tn, constness, ct, Method, ...) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ - GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ == 1), \ this_method_does_not_take_1_argument); \ @@ -392,7 +391,7 @@ using internal::FunctionMocker; GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2) constness { \ - GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ == 2), \ this_method_does_not_take_2_arguments); \ @@ -414,7 +413,7 @@ using internal::FunctionMocker; GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3) constness { \ - GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ == 3), \ this_method_does_not_take_3_arguments); \ @@ -440,7 +439,7 @@ using internal::FunctionMocker; GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ - GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ == 4), \ this_method_does_not_take_4_arguments); \ @@ -468,7 +467,7 @@ using internal::FunctionMocker; GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5) constness { \ - GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ == 5), \ this_method_does_not_take_5_arguments); \ @@ -498,7 +497,7 @@ using internal::FunctionMocker; GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6) constness { \ - GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ == 6), \ this_method_does_not_take_6_arguments); \ @@ -530,7 +529,7 @@ using internal::FunctionMocker; GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ - GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ == 7), \ this_method_does_not_take_7_arguments); \ @@ -564,7 +563,7 @@ using internal::FunctionMocker; GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8) constness { \ - GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ == 8), \ this_method_does_not_take_8_arguments); \ @@ -600,7 +599,7 @@ using internal::FunctionMocker; GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \ GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9) constness { \ - GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ == 9), \ this_method_does_not_take_9_arguments); \ @@ -640,7 +639,7 @@ using internal::FunctionMocker; GMOCK_ARG_(tn, 8, __VA_ARGS__) gmock_a8, \ GMOCK_ARG_(tn, 9, __VA_ARGS__) gmock_a9, \ GMOCK_ARG_(tn, 10, __VA_ARGS__) gmock_a10) constness { \ - GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ == 10), \ this_method_does_not_take_10_arguments); \ diff --git a/include/gmock/gmock-generated-function-mockers.h.pump b/include/gmock/gmock-generated-function-mockers.h.pump index f050caf1..be819961 100644 --- a/include/gmock/gmock-generated-function-mockers.h.pump +++ b/include/gmock/gmock-generated-function-mockers.h.pump @@ -78,7 +78,7 @@ class FunctionMocker : public MockSpec& With($matchers) { $if i >= 1 [[ - this->current_spec().SetMatchers(::std::tr1::make_tuple($ms)); + this->current_spec().SetMatchers(::testing::make_tuple($ms)); ]] return this->current_spec(); @@ -139,7 +139,7 @@ $var matcher_as = [[$for j, \ #define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ $arg_as) constness { \ - GTEST_COMPILE_ASSERT_((::std::tr1::tuple_size< \ + GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value == $i), \ this_method_does_not_take_$i[[]]_argument[[$if i != 1 [[s]]]]); \ GMOCK_MOCKER_($i, constness, Method).SetOwnerAndName(this, #Method); \ diff --git a/include/gmock/gmock-generated-matchers.h b/include/gmock/gmock-generated-matchers.h index b4c85715..967fcf9f 100644 --- a/include/gmock/gmock-generated-matchers.h +++ b/include/gmock/gmock-generated-matchers.h @@ -49,7 +49,7 @@ namespace internal { // The type of the i-th (0-based) field of Tuple. #define GMOCK_FIELD_TYPE_(Tuple, i) \ - typename ::std::tr1::tuple_element::type + typename ::testing::tuple_element::type // TupleFields is for selecting fields from a // tuple of type Tuple. It has two members: @@ -72,14 +72,13 @@ template class TupleFields { public: - typedef ::std::tr1::tuple type; static type GetSelectedFields(const Tuple& t) { - using ::std::tr1::get; return type(get(t), get(t), get(t), get(t), get(t), get(t), get(t), get(t), get(t), get(t)); } @@ -90,9 +89,8 @@ class TupleFields { template class TupleFields { public: - typedef ::std::tr1::tuple<> type; + typedef ::testing::tuple<> type; static type GetSelectedFields(const Tuple& /* t */) { - using ::std::tr1::get; return type(); } }; @@ -100,9 +98,8 @@ class TupleFields { template class TupleFields { public: - typedef ::std::tr1::tuple type; + typedef ::testing::tuple type; static type GetSelectedFields(const Tuple& t) { - using ::std::tr1::get; return type(get(t)); } }; @@ -110,10 +107,9 @@ class TupleFields { template class TupleFields { public: - typedef ::std::tr1::tuple type; static type GetSelectedFields(const Tuple& t) { - using ::std::tr1::get; return type(get(t), get(t)); } }; @@ -121,10 +117,9 @@ class TupleFields { template class TupleFields { public: - typedef ::std::tr1::tuple type; static type GetSelectedFields(const Tuple& t) { - using ::std::tr1::get; return type(get(t), get(t), get(t)); } }; @@ -132,11 +127,10 @@ class TupleFields { template class TupleFields { public: - typedef ::std::tr1::tuple type; static type GetSelectedFields(const Tuple& t) { - using ::std::tr1::get; return type(get(t), get(t), get(t), get(t)); } }; @@ -144,11 +138,10 @@ class TupleFields { template class TupleFields { public: - typedef ::std::tr1::tuple type; static type GetSelectedFields(const Tuple& t) { - using ::std::tr1::get; return type(get(t), get(t), get(t), get(t), get(t)); } }; @@ -156,12 +149,11 @@ class TupleFields { template class TupleFields { public: - typedef ::std::tr1::tuple type; static type GetSelectedFields(const Tuple& t) { - using ::std::tr1::get; return type(get(t), get(t), get(t), get(t), get(t), get(t)); } @@ -170,12 +162,11 @@ class TupleFields { template class TupleFields { public: - typedef ::std::tr1::tuple type; static type GetSelectedFields(const Tuple& t) { - using ::std::tr1::get; return type(get(t), get(t), get(t), get(t), get(t), get(t), get(t)); } @@ -185,13 +176,12 @@ template class TupleFields { public: - typedef ::std::tr1::tuple type; static type GetSelectedFields(const Tuple& t) { - using ::std::tr1::get; return type(get(t), get(t), get(t), get(t), get(t), get(t), get(t), get(t)); } @@ -201,13 +191,12 @@ template class TupleFields { public: - typedef ::std::tr1::tuple type; static type GetSelectedFields(const Tuple& t) { - using ::std::tr1::get; return type(get(t), get(t), get(t), get(t), get(t), get(t), get(t), get(t), get(t)); } @@ -577,29 +566,29 @@ Args(const InnerMatcher& matcher) { // undefined (e.g. hash_map). inline internal::ElementsAreMatcher< - std::tr1::tuple<> > + ::testing::tuple<> > ElementsAre() { - typedef std::tr1::tuple<> Args; + typedef ::testing::tuple<> Args; return internal::ElementsAreMatcher(Args()); } template inline internal::ElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type> > ElementsAre(const T1& e1) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type> Args; return internal::ElementsAreMatcher(Args(e1)); } template inline internal::ElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type> > ElementsAre(const T1& e1, const T2& e2) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type> Args; return internal::ElementsAreMatcher(Args(e1, e2)); @@ -607,12 +596,12 @@ ElementsAre(const T1& e1, const T2& e2) { template inline internal::ElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type> > ElementsAre(const T1& e1, const T2& e2, const T3& e3) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type> Args; @@ -621,13 +610,13 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3) { template inline internal::ElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type> > ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -637,7 +626,7 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) { template inline internal::ElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -645,7 +634,7 @@ inline internal::ElementsAreMatcher< typename internal::DecayArray::type> > ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, const T5& e5) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -657,7 +646,7 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, template inline internal::ElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -666,7 +655,7 @@ inline internal::ElementsAreMatcher< typename internal::DecayArray::type> > ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, const T5& e5, const T6& e6) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -679,7 +668,7 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, template inline internal::ElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -689,7 +678,7 @@ inline internal::ElementsAreMatcher< typename internal::DecayArray::type> > ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, const T5& e5, const T6& e6, const T7& e7) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -703,7 +692,7 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, template inline internal::ElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -714,7 +703,7 @@ inline internal::ElementsAreMatcher< typename internal::DecayArray::type> > ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, const T5& e5, const T6& e6, const T7& e7, const T8& e8) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -730,7 +719,7 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, template inline internal::ElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -742,7 +731,7 @@ inline internal::ElementsAreMatcher< typename internal::DecayArray::type> > ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -759,7 +748,7 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, template inline internal::ElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -773,7 +762,7 @@ inline internal::ElementsAreMatcher< ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9, const T10& e10) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -792,29 +781,29 @@ ElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, // that matches n elements in any order. We support up to n=10 arguments. inline internal::UnorderedElementsAreMatcher< - std::tr1::tuple<> > + ::testing::tuple<> > UnorderedElementsAre() { - typedef std::tr1::tuple<> Args; + typedef ::testing::tuple<> Args; return internal::UnorderedElementsAreMatcher(Args()); } template inline internal::UnorderedElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type> > UnorderedElementsAre(const T1& e1) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type> Args; return internal::UnorderedElementsAreMatcher(Args(e1)); } template inline internal::UnorderedElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type> > UnorderedElementsAre(const T1& e1, const T2& e2) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type> Args; return internal::UnorderedElementsAreMatcher(Args(e1, e2)); @@ -822,12 +811,12 @@ UnorderedElementsAre(const T1& e1, const T2& e2) { template inline internal::UnorderedElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type> > UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type> Args; @@ -836,13 +825,13 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3) { template inline internal::UnorderedElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type> > UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -852,7 +841,7 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4) { template inline internal::UnorderedElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -860,7 +849,7 @@ inline internal::UnorderedElementsAreMatcher< typename internal::DecayArray::type> > UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, const T5& e5) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -872,7 +861,7 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, template inline internal::UnorderedElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -881,7 +870,7 @@ inline internal::UnorderedElementsAreMatcher< typename internal::DecayArray::type> > UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, const T5& e5, const T6& e6) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -895,7 +884,7 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, template inline internal::UnorderedElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -905,7 +894,7 @@ inline internal::UnorderedElementsAreMatcher< typename internal::DecayArray::type> > UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, const T5& e5, const T6& e6, const T7& e7) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -920,7 +909,7 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, template inline internal::UnorderedElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -931,7 +920,7 @@ inline internal::UnorderedElementsAreMatcher< typename internal::DecayArray::type> > UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, const T5& e5, const T6& e6, const T7& e7, const T8& e8) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -947,7 +936,7 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, template inline internal::UnorderedElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -959,7 +948,7 @@ inline internal::UnorderedElementsAreMatcher< typename internal::DecayArray::type> > UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -976,7 +965,7 @@ UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, template inline internal::UnorderedElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -990,7 +979,7 @@ inline internal::UnorderedElementsAreMatcher< UnorderedElementsAre(const T1& e1, const T2& e2, const T3& e3, const T4& e4, const T5& e5, const T6& e6, const T7& e7, const T8& e8, const T9& e9, const T10& e10) { - typedef std::tr1::tuple< + typedef ::testing::tuple< typename internal::DecayArray::type, typename internal::DecayArray::type, typename internal::DecayArray::type, @@ -1413,7 +1402,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::std::tr1::tuple<>()));\ + ::testing::tuple<>()));\ }\ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ };\ @@ -1462,7 +1451,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::std::tr1::tuple(p0)));\ + ::testing::tuple(p0)));\ }\ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ };\ @@ -1515,7 +1504,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::std::tr1::tuple(p0, p1)));\ + ::testing::tuple(p0, p1)));\ }\ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ };\ @@ -1573,7 +1562,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::std::tr1::tuple(p0, p1, \ + ::testing::tuple(p0, p1, \ p2)));\ }\ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ @@ -1636,7 +1625,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::std::tr1::tuple(p0, p1, p2, p3)));\ }\ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ @@ -1707,7 +1696,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::std::tr1::tuple(p0, p1, p2, p3, p4)));\ }\ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ @@ -1781,7 +1770,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::std::tr1::tuple(p0, p1, p2, p3, p4, p5)));\ }\ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ @@ -1859,7 +1848,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::std::tr1::tuple(p0, p1, p2, p3, p4, p5, \ p6)));\ }\ @@ -1944,7 +1933,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::std::tr1::tuple(p0, p1, p2, \ p3, p4, p5, p6, p7)));\ }\ @@ -2035,7 +2024,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::std::tr1::tuple(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\ }\ @@ -2131,7 +2120,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::std::tr1::tuple(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\ }\ diff --git a/include/gmock/gmock-generated-matchers.h.pump b/include/gmock/gmock-generated-matchers.h.pump index af02acbc..4b618a43 100644 --- a/include/gmock/gmock-generated-matchers.h.pump +++ b/include/gmock/gmock-generated-matchers.h.pump @@ -53,7 +53,7 @@ $range i 0..n-1 // The type of the i-th (0-based) field of Tuple. #define GMOCK_FIELD_TYPE_(Tuple, i) \ - typename ::std::tr1::tuple_element::type + typename ::testing::tuple_element::type // TupleFields is for selecting fields from a // tuple of type Tuple. It has two members: @@ -73,9 +73,8 @@ class TupleFields; template class TupleFields { public: - typedef ::std::tr1::tuple<$for i, [[GMOCK_FIELD_TYPE_(Tuple, k$i)]]> type; + typedef ::testing::tuple<$for i, [[GMOCK_FIELD_TYPE_(Tuple, k$i)]]> type; static type GetSelectedFields(const Tuple& t) { - using ::std::tr1::get; return type($for i, [[get(t)]]); } }; @@ -90,9 +89,8 @@ $range k 0..n-1 template class TupleFields { public: - typedef ::std::tr1::tuple<$for j, [[GMOCK_FIELD_TYPE_(Tuple, k$j)]]> type; + typedef ::testing::tuple<$for j, [[GMOCK_FIELD_TYPE_(Tuple, k$j)]]> type; static type GetSelectedFields(const Tuple& $if i==0 [[/* t */]] $else [[t]]) { - using ::std::tr1::get; return type($for j, [[get(t)]]); } }; @@ -289,12 +287,12 @@ template <$for j, [[typename T$j]]> ]] inline internal::ElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< $for j, [[ typename internal::DecayArray::type]]> > ElementsAre($for j, [[const T$j& e$j]]) { - typedef std::tr1::tuple< + typedef ::testing::tuple< $for j, [[ typename internal::DecayArray::type]]> Args; @@ -317,12 +315,12 @@ template <$for j, [[typename T$j]]> ]] inline internal::UnorderedElementsAreMatcher< - std::tr1::tuple< + ::testing::tuple< $for j, [[ typename internal::DecayArray::type]]> > UnorderedElementsAre($for j, [[const T$j& e$j]]) { - typedef std::tr1::tuple< + typedef ::testing::tuple< $for j, [[ typename internal::DecayArray::type]]> Args; @@ -646,7 +644,7 @@ $var param_field_decls2 = [[$for j return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::std::tr1::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\ + ::testing::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\ }\ GTEST_DISALLOW_ASSIGN_(gmock_Impl);\ };\ diff --git a/include/gmock/gmock-matchers.h b/include/gmock/gmock-matchers.h index de966a7a..086cac39 100644 --- a/include/gmock/gmock-matchers.h +++ b/include/gmock/gmock-matchers.h @@ -706,7 +706,6 @@ class TuplePrefix { template static bool Matches(const MatcherTuple& matcher_tuple, const ValueTuple& value_tuple) { - using ::std::tr1::get; return TuplePrefix::Matches(matcher_tuple, value_tuple) && get(matcher_tuple).Matches(get(value_tuple)); } @@ -719,9 +718,6 @@ class TuplePrefix { static void ExplainMatchFailuresTo(const MatcherTuple& matchers, const ValueTuple& values, ::std::ostream* os) { - using ::std::tr1::tuple_element; - using ::std::tr1::get; - // First, describes failures in the first N - 1 fields. TuplePrefix::ExplainMatchFailuresTo(matchers, values, os); @@ -774,7 +770,6 @@ class TuplePrefix<0> { template bool TupleMatches(const MatcherTuple& matcher_tuple, const ValueTuple& value_tuple) { - using ::std::tr1::tuple_size; // Makes sure that matcher_tuple and value_tuple have the same // number of fields. GTEST_COMPILE_ASSERT_(tuple_size::value == @@ -790,7 +785,6 @@ template void ExplainMatchFailureTupleTo(const MatcherTuple& matchers, const ValueTuple& values, ::std::ostream* os) { - using ::std::tr1::tuple_size; TuplePrefix::value>::ExplainMatchFailuresTo( matchers, values, os); } @@ -802,7 +796,7 @@ void ExplainMatchFailureTupleTo(const MatcherTuple& matchers, template class TransformTupleValuesHelper { private: - typedef typename ::std::tr1::tuple_size TupleSize; + typedef ::testing::tuple_size TupleSize; public: // For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'. @@ -815,7 +809,7 @@ class TransformTupleValuesHelper { template struct IterateOverTuple { OutIter operator() (Func f, const Tup& t, OutIter out) const { - *out++ = f(::std::tr1::get(t)); + *out++ = f(::testing::get(t)); return IterateOverTuple()(f, t, out); } }; @@ -1322,12 +1316,12 @@ class MatchesRegexMatcher { class name##2Matcher { \ public: \ template \ - operator Matcher< ::std::tr1::tuple >() const { \ - return MakeMatcher(new Impl< ::std::tr1::tuple >); \ + operator Matcher< ::testing::tuple >() const { \ + return MakeMatcher(new Impl< ::testing::tuple >); \ } \ template \ - operator Matcher&>() const { \ - return MakeMatcher(new Impl&>); \ + operator Matcher&>() const { \ + return MakeMatcher(new Impl&>); \ } \ private: \ template \ @@ -1336,10 +1330,10 @@ class MatchesRegexMatcher { virtual bool MatchAndExplain( \ Tuple args, \ MatchResultListener* /* listener */) const { \ - return ::std::tr1::get<0>(args) op ::std::tr1::get<1>(args); \ + return ::testing::get<0>(args) op ::testing::get<1>(args); \ } \ virtual void DescribeTo(::std::ostream* os) const { \ - *os << "are " relation; \ + *os << "are " relation; \ } \ virtual void DescribeNegationTo(::std::ostream* os) const { \ *os << "aren't " relation; \ @@ -2543,7 +2537,7 @@ class PointwiseMatcher { // reference, as they may be expensive to copy. We must use tuple // instead of pair here, as a pair cannot hold references (C++ 98, // 20.2.2 [lib.pairs]). - typedef ::std::tr1::tuple InnerMatcherArg; + typedef ::testing::tuple InnerMatcherArg; Impl(const TupleMatcher& tuple_matcher, const RhsStlContainer& rhs) // mono_tuple_matcher_ holds a monomorphic version of the tuple matcher. @@ -3280,7 +3274,7 @@ class UnorderedElementsAreMatcher { typedef typename View::value_type Element; typedef ::std::vector > MatcherVec; MatcherVec matchers; - matchers.reserve(::std::tr1::tuple_size::value); + matchers.reserve(::testing::tuple_size::value); TransformTupleValues(CastAndAppendTransform(), matchers_, ::std::back_inserter(matchers)); return MakeMatcher(new UnorderedElementsAreMatcherImpl( @@ -3305,7 +3299,7 @@ class ElementsAreMatcher { typedef typename View::value_type Element; typedef ::std::vector > MatcherVec; MatcherVec matchers; - matchers.reserve(::std::tr1::tuple_size::value); + matchers.reserve(::testing::tuple_size::value); TransformTupleValues(CastAndAppendTransform(), matchers_, ::std::back_inserter(matchers)); return MakeMatcher(new ElementsAreMatcherImpl( diff --git a/include/gmock/gmock-more-actions.h b/include/gmock/gmock-more-actions.h index 73b9deae..c754440e 100644 --- a/include/gmock/gmock-more-actions.h +++ b/include/gmock/gmock-more-actions.h @@ -158,7 +158,7 @@ WithArg(const InnerAction& action) { ACTION_TEMPLATE(ReturnArg, HAS_1_TEMPLATE_PARAMS(int, k), AND_0_VALUE_PARAMS()) { - return std::tr1::get(args); + return ::testing::get(args); } // Action SaveArg(pointer) saves the k-th (0-based) argument of the @@ -166,7 +166,7 @@ ACTION_TEMPLATE(ReturnArg, ACTION_TEMPLATE(SaveArg, HAS_1_TEMPLATE_PARAMS(int, k), AND_1_VALUE_PARAMS(pointer)) { - *pointer = ::std::tr1::get(args); + *pointer = ::testing::get(args); } // Action SaveArgPointee(pointer) saves the value pointed to @@ -174,7 +174,7 @@ ACTION_TEMPLATE(SaveArg, ACTION_TEMPLATE(SaveArgPointee, HAS_1_TEMPLATE_PARAMS(int, k), AND_1_VALUE_PARAMS(pointer)) { - *pointer = *::std::tr1::get(args); + *pointer = *::testing::get(args); } // Action SetArgReferee(value) assigns 'value' to the variable @@ -182,13 +182,13 @@ ACTION_TEMPLATE(SaveArgPointee, ACTION_TEMPLATE(SetArgReferee, HAS_1_TEMPLATE_PARAMS(int, k), AND_1_VALUE_PARAMS(value)) { - typedef typename ::std::tr1::tuple_element::type argk_type; + typedef typename ::testing::tuple_element::type argk_type; // Ensures that argument #k is a reference. If you get a compiler // error on the next line, you are using SetArgReferee(value) in // a mock function whose k-th (0-based) argument is not a reference. GTEST_COMPILE_ASSERT_(internal::is_reference::value, SetArgReferee_must_be_used_with_a_reference_argument); - ::std::tr1::get(args) = value; + ::testing::get(args) = value; } // Action SetArrayArgument(first, last) copies the elements in @@ -201,9 +201,9 @@ ACTION_TEMPLATE(SetArrayArgument, AND_2_VALUE_PARAMS(first, last)) { // Visual Studio deprecates ::std::copy, so we use our own copy in that case. #ifdef _MSC_VER - internal::CopyElements(first, last, ::std::tr1::get(args)); + internal::CopyElements(first, last, ::testing::get(args)); #else - ::std::copy(first, last, ::std::tr1::get(args)); + ::std::copy(first, last, ::testing::get(args)); #endif } @@ -212,7 +212,7 @@ ACTION_TEMPLATE(SetArrayArgument, ACTION_TEMPLATE(DeleteArg, HAS_1_TEMPLATE_PARAMS(int, k), AND_0_VALUE_PARAMS()) { - delete ::std::tr1::get(args); + delete ::testing::get(args); } // This action returns the value pointed to by 'pointer'. diff --git a/include/gmock/internal/gmock-generated-internal-utils.h b/include/gmock/internal/gmock-generated-internal-utils.h index 02258451..7811e43f 100644 --- a/include/gmock/internal/gmock-generated-internal-utils.h +++ b/include/gmock/internal/gmock-generated-internal-utils.h @@ -69,70 +69,70 @@ template struct MatcherTuple; template <> -struct MatcherTuple< ::std::tr1::tuple<> > { - typedef ::std::tr1::tuple< > type; +struct MatcherTuple< ::testing::tuple<> > { + typedef ::testing::tuple< > type; }; template -struct MatcherTuple< ::std::tr1::tuple > { - typedef ::std::tr1::tuple > type; +struct MatcherTuple< ::testing::tuple > { + typedef ::testing::tuple > type; }; template -struct MatcherTuple< ::std::tr1::tuple > { - typedef ::std::tr1::tuple, Matcher > type; +struct MatcherTuple< ::testing::tuple > { + typedef ::testing::tuple, Matcher > type; }; template -struct MatcherTuple< ::std::tr1::tuple > { - typedef ::std::tr1::tuple, Matcher, Matcher > type; +struct MatcherTuple< ::testing::tuple > { + typedef ::testing::tuple, Matcher, Matcher > type; }; template -struct MatcherTuple< ::std::tr1::tuple > { - typedef ::std::tr1::tuple, Matcher, Matcher, +struct MatcherTuple< ::testing::tuple > { + typedef ::testing::tuple, Matcher, Matcher, Matcher > type; }; template -struct MatcherTuple< ::std::tr1::tuple > { - typedef ::std::tr1::tuple, Matcher, Matcher, Matcher, +struct MatcherTuple< ::testing::tuple > { + typedef ::testing::tuple, Matcher, Matcher, Matcher, Matcher > type; }; template -struct MatcherTuple< ::std::tr1::tuple > { - typedef ::std::tr1::tuple, Matcher, Matcher, Matcher, +struct MatcherTuple< ::testing::tuple > { + typedef ::testing::tuple, Matcher, Matcher, Matcher, Matcher, Matcher > type; }; template -struct MatcherTuple< ::std::tr1::tuple > { - typedef ::std::tr1::tuple, Matcher, Matcher, Matcher, +struct MatcherTuple< ::testing::tuple > { + typedef ::testing::tuple, Matcher, Matcher, Matcher, Matcher, Matcher, Matcher > type; }; template -struct MatcherTuple< ::std::tr1::tuple > { - typedef ::std::tr1::tuple, Matcher, Matcher, Matcher, +struct MatcherTuple< ::testing::tuple > { + typedef ::testing::tuple, Matcher, Matcher, Matcher, Matcher, Matcher, Matcher, Matcher > type; }; template -struct MatcherTuple< ::std::tr1::tuple > { - typedef ::std::tr1::tuple, Matcher, Matcher, Matcher, +struct MatcherTuple< ::testing::tuple > { + typedef ::testing::tuple, Matcher, Matcher, Matcher, Matcher, Matcher, Matcher, Matcher, Matcher > type; }; template -struct MatcherTuple< ::std::tr1::tuple > { - typedef ::std::tr1::tuple, Matcher, Matcher, Matcher, + typedef ::testing::tuple, Matcher, Matcher, Matcher, Matcher, Matcher, Matcher, Matcher, Matcher, Matcher > type; }; @@ -156,7 +156,7 @@ struct Function; template struct Function { typedef R Result; - typedef ::std::tr1::tuple<> ArgumentTuple; + typedef ::testing::tuple<> ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(); typedef IgnoredValue MakeResultIgnoredValue(); @@ -166,7 +166,7 @@ template struct Function : Function { typedef A1 Argument1; - typedef ::std::tr1::tuple ArgumentTuple; + typedef ::testing::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1); typedef IgnoredValue MakeResultIgnoredValue(A1); @@ -176,7 +176,7 @@ template struct Function : Function { typedef A2 Argument2; - typedef ::std::tr1::tuple ArgumentTuple; + typedef ::testing::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2); typedef IgnoredValue MakeResultIgnoredValue(A1, A2); @@ -186,7 +186,7 @@ template struct Function : Function { typedef A3 Argument3; - typedef ::std::tr1::tuple ArgumentTuple; + typedef ::testing::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3); @@ -196,7 +196,7 @@ template struct Function : Function { typedef A4 Argument4; - typedef ::std::tr1::tuple ArgumentTuple; + typedef ::testing::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4); @@ -207,7 +207,7 @@ template : Function { typedef A5 Argument5; - typedef ::std::tr1::tuple ArgumentTuple; + typedef ::testing::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5); @@ -218,7 +218,7 @@ template : Function { typedef A6 Argument6; - typedef ::std::tr1::tuple ArgumentTuple; + typedef ::testing::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6); @@ -229,7 +229,7 @@ template : Function { typedef A7 Argument7; - typedef ::std::tr1::tuple ArgumentTuple; + typedef ::testing::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7); @@ -240,7 +240,7 @@ template : Function { typedef A8 Argument8; - typedef ::std::tr1::tuple ArgumentTuple; + typedef ::testing::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8); @@ -251,7 +251,7 @@ template : Function { typedef A9 Argument9; - typedef ::std::tr1::tuple ArgumentTuple; + typedef ::testing::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8, @@ -264,7 +264,7 @@ template : Function { typedef A10 Argument10; - typedef ::std::tr1::tuple ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); diff --git a/include/gmock/internal/gmock-generated-internal-utils.h.pump b/include/gmock/internal/gmock-generated-internal-utils.h.pump index e7ecc8b8..800af17c 100644 --- a/include/gmock/internal/gmock-generated-internal-utils.h.pump +++ b/include/gmock/internal/gmock-generated-internal-utils.h.pump @@ -77,8 +77,8 @@ $var typename_As = [[$for j, [[typename A$j]]]] $var As = [[$for j, [[A$j]]]] $var matcher_As = [[$for j, [[Matcher]]]] template <$typename_As> -struct MatcherTuple< ::std::tr1::tuple<$As> > { - typedef ::std::tr1::tuple<$matcher_As > type; +struct MatcherTuple< ::testing::tuple<$As> > { + typedef ::testing::tuple<$matcher_As > type; }; @@ -102,7 +102,7 @@ struct Function; template struct Function { typedef R Result; - typedef ::std::tr1::tuple<> ArgumentTuple; + typedef ::testing::tuple<> ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid(); typedef IgnoredValue MakeResultIgnoredValue(); @@ -121,7 +121,7 @@ template struct Function : Function { typedef A$i Argument$i; - typedef ::std::tr1::tuple<$As> ArgumentTuple; + typedef ::testing::tuple<$As> ArgumentTuple; typedef typename MatcherTuple::type ArgumentMatcherTuple; typedef void MakeResultVoid($As); typedef IgnoredValue MakeResultIgnoredValue($As); diff --git a/include/gmock/internal/gmock-internal-utils.h b/include/gmock/internal/gmock-internal-utils.h index 2f530d4e..6110dd7b 100644 --- a/include/gmock/internal/gmock-internal-utils.h +++ b/include/gmock/internal/gmock-internal-utils.h @@ -464,7 +464,7 @@ class StlContainerView { // This specialization is used when RawContainer is a native array // represented as a (pointer, size) tuple. template -class StlContainerView< ::std::tr1::tuple > { +class StlContainerView< ::testing::tuple > { public: typedef GTEST_REMOVE_CONST_( typename internal::PointeeOf::type) RawElement; @@ -472,12 +472,10 @@ class StlContainerView< ::std::tr1::tuple > { typedef const type const_reference; static const_reference ConstReference( - const ::std::tr1::tuple& array) { - using ::std::tr1::get; + const ::testing::tuple& array) { return type(get<0>(array), get<1>(array), kReference); } - static type Copy(const ::std::tr1::tuple& array) { - using ::std::tr1::get; + static type Copy(const ::testing::tuple& array) { return type(get<0>(array), get<1>(array), kCopy); } }; diff --git a/test/gmock-actions_test.cc b/test/gmock-actions_test.cc index 115a9020..275dbbf5 100644 --- a/test/gmock-actions_test.cc +++ b/test/gmock-actions_test.cc @@ -45,10 +45,10 @@ namespace { -using ::std::tr1::get; -using ::std::tr1::make_tuple; -using ::std::tr1::tuple; -using ::std::tr1::tuple_element; +using testing::get; +using testing::make_tuple; +using testing::tuple; +using testing::tuple_element; using testing::internal::BuiltInDefaultValue; using testing::internal::Int64; using testing::internal::UInt64; diff --git a/test/gmock-generated-actions_test.cc b/test/gmock-generated-actions_test.cc index a1fa6aee..784c59d1 100644 --- a/test/gmock-generated-actions_test.cc +++ b/test/gmock-generated-actions_test.cc @@ -46,10 +46,10 @@ namespace gmock_generated_actions_test { using ::std::plus; using ::std::string; -using ::std::tr1::get; -using ::std::tr1::make_tuple; -using ::std::tr1::tuple; -using ::std::tr1::tuple_element; +using testing::get; +using testing::make_tuple; +using testing::tuple; +using testing::tuple_element; using testing::_; using testing::Action; using testing::ActionInterface; @@ -639,7 +639,7 @@ TEST(ActionMacroTest, CanReferenceArgumentType) { // Tests that the body of ACTION() can reference the argument tuple // via args_type and args. ACTION(Sum2) { - StaticAssertTypeEq< ::std::tr1::tuple, args_type>(); + StaticAssertTypeEq, args_type>(); args_type args_copy = args; return get<0>(args_copy) + get<1>(args_copy); } @@ -1098,7 +1098,7 @@ TEST(ActionTemplateTest, WorksWithValueParams) { ACTION_TEMPLATE(MyDeleteArg, HAS_1_TEMPLATE_PARAMS(int, k), AND_0_VALUE_PARAMS()) { - delete std::tr1::get(args); + delete get(args); } // Resets a bool variable in the destructor. diff --git a/test/gmock-generated-internal-utils_test.cc b/test/gmock-generated-internal-utils_test.cc index 1156c7db..e0a535a3 100644 --- a/test/gmock-generated-internal-utils_test.cc +++ b/test/gmock-generated-internal-utils_test.cc @@ -39,7 +39,7 @@ namespace { -using ::std::tr1::tuple; +using ::testing::tuple; using ::testing::Matcher; using ::testing::internal::CompileAssertTypesEqual; using ::testing::internal::MatcherTuple; diff --git a/test/gmock-generated-matchers_test.cc b/test/gmock-generated-matchers_test.cc index ff235001..0e9f77f5 100644 --- a/test/gmock-generated-matchers_test.cc +++ b/test/gmock-generated-matchers_test.cc @@ -53,9 +53,9 @@ using std::pair; using std::set; using std::stringstream; using std::vector; -using std::tr1::get; -using std::tr1::make_tuple; -using std::tr1::tuple; +using testing::get; +using testing::make_tuple; +using testing::tuple; using testing::_; using testing::Args; using testing::Contains; @@ -507,7 +507,7 @@ class NativeArrayPassedAsPointerAndSize { TEST(ElementsAreTest, WorksWithNativeArrayPassedAsPointerAndSize) { int array[] = { 0, 1 }; - ::std::tr1::tuple array_as_tuple(array, 2); + ::testing::tuple array_as_tuple(array, 2); EXPECT_THAT(array_as_tuple, ElementsAre(0, 1)); EXPECT_THAT(array_as_tuple, Not(ElementsAre(0))); @@ -561,7 +561,7 @@ TEST(ElementsAreTest, MakesCopyOfArguments) { int x = 1; int y = 2; // This should make a copy of x and y. - ::testing::internal::ElementsAreMatcher > + ::testing::internal::ElementsAreMatcher > polymorphic_matcher = ElementsAre(x, y); // Changing x and y now shouldn't affect the meaning of the above matcher. x = y = 0; diff --git a/test/gmock-internal-utils_test.cc b/test/gmock-internal-utils_test.cc index b6a66440..e5e842a1 100644 --- a/test/gmock-internal-utils_test.cc +++ b/test/gmock-internal-utils_test.cc @@ -59,9 +59,6 @@ namespace internal { namespace { -using ::std::tr1::make_tuple; -using ::std::tr1::tuple; - TEST(ConvertIdentifierNameToWordsTest, WorksWhenNameContainsNoWord) { EXPECT_EQ("", ConvertIdentifierNameToWords("")); EXPECT_EQ("", ConvertIdentifierNameToWords("_")); diff --git a/test/gmock-matchers_test.cc b/test/gmock-matchers_test.cc index 68a027bf..0f6bcb29 100644 --- a/test/gmock-matchers_test.cc +++ b/test/gmock-matchers_test.cc @@ -81,9 +81,9 @@ using std::ostream; using std::pair; using std::set; using std::stringstream; -using std::tr1::get; -using std::tr1::make_tuple; -using std::tr1::tuple; +using testing::get; +using testing::make_tuple; +using testing::tuple; using std::vector; using testing::A; using testing::AllArgs; @@ -1896,7 +1896,7 @@ TEST(GlobalWideEndsWithTest, CanDescribeSelf) { #endif // GTEST_HAS_GLOBAL_WSTRING -typedef ::std::tr1::tuple Tuple2; // NOLINT +typedef ::testing::tuple Tuple2; // NOLINT // Tests that Eq() matches a 2-tuple where the first field == the // second field. diff --git a/test/gmock-more-actions_test.cc b/test/gmock-more-actions_test.cc index eb516d22..9477fe9f 100644 --- a/test/gmock-more-actions_test.cc +++ b/test/gmock-more-actions_test.cc @@ -47,10 +47,10 @@ namespace gmock_more_actions_test { using ::std::plus; using ::std::string; -using ::std::tr1::get; -using ::std::tr1::make_tuple; -using ::std::tr1::tuple; -using ::std::tr1::tuple_element; +using testing::get; +using testing::make_tuple; +using testing::tuple; +using testing::tuple_element; using testing::_; using testing::Action; using testing::ActionInterface;