diff options
Diffstat (limited to 'googlemock/include/gmock')
13 files changed, 1179 insertions, 1800 deletions
diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index e3b3f094..d4af9490 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -43,6 +43,7 @@ #include <algorithm> #include <string> +#include <utility> #include "gmock/internal/gmock-internal-utils.h" #include "gmock/internal/gmock-port.h" @@ -439,7 +440,7 @@ class Action { // template <typename Result, typename ArgumentTuple> // Result Perform(const ArgumentTuple& args) const { // // Processes the arguments and returns a result, using -// // tr1::get<N>(args) to get the N-th (0-based) argument in the tuple. +// // std::get<N>(args) to get the N-th (0-based) argument in the tuple. // } // ... // }; @@ -527,7 +528,7 @@ class ActionAdaptor : public ActionInterface<F1> { // on return. Useful for move-only types, but could be used on any type. template <typename T> struct ByMoveWrapper { - explicit ByMoveWrapper(T value) : payload(internal::move(value)) {} + explicit ByMoveWrapper(T value) : payload(std::move(value)) {} T payload; }; @@ -564,7 +565,7 @@ class ReturnAction { // Constructs a ReturnAction object from the value to be returned. // 'value' is passed by value instead of by const reference in order // to allow Return("string literal") to compile. - explicit ReturnAction(R value) : value_(new R(internal::move(value))) {} + explicit ReturnAction(R value) : value_(new R(std::move(value))) {} // This template type conversion operator allows Return(x) to be // used in ANY function that returns x's type. @@ -632,7 +633,7 @@ class ReturnAction { GTEST_CHECK_(!performed_) << "A ByMove() action should only be performed once."; performed_ = true; - return internal::move(wrapper_->payload); + return std::move(wrapper_->payload); } private: @@ -838,7 +839,7 @@ class SetArgumentPointeeAction { template <typename Result, typename ArgumentTuple> void Perform(const ArgumentTuple& args) const { CompileAssertTypesEqual<void, Result>(); - *::testing::get<N>(args) = value_; + *::std::get<N>(args) = value_; } private: @@ -861,7 +862,7 @@ class SetArgumentPointeeAction<N, Proto, true> { template <typename Result, typename ArgumentTuple> void Perform(const ArgumentTuple& args) const { CompileAssertTypesEqual<void, Result>(); - ::testing::get<N>(args)->CopyFrom(*proto_); + ::std::get<N>(args)->CopyFrom(*proto_); } private: @@ -1116,7 +1117,7 @@ Action<To>::Action(const Action<From>& from) // will trigger a compiler error about using array as initializer. template <typename R> internal::ReturnAction<R> Return(R value) { - return internal::ReturnAction<R>(internal::move(value)); + return internal::ReturnAction<R>(std::move(value)); } // Creates an action that returns NULL. @@ -1149,7 +1150,7 @@ inline internal::ReturnRefOfCopyAction<R> ReturnRefOfCopy(const R& x) { // invariant. template <typename R> internal::ByMoveWrapper<R> ByMove(R x) { - return internal::ByMoveWrapper<R>(internal::move(x)); + return internal::ByMoveWrapper<R>(std::move(x)); } // Creates an action that does the default action for the give mock function. diff --git a/googlemock/include/gmock/gmock-generated-actions.h b/googlemock/include/gmock/gmock-generated-actions.h index 260036da..0845b221 100644 --- a/googlemock/include/gmock/gmock-generated-actions.h +++ b/googlemock/include/gmock/gmock-generated-actions.h @@ -41,6 +41,8 @@ #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ +#include <utility> + #include "gmock/gmock-actions.h" #include "gmock/internal/gmock-port.h" @@ -54,164 +56,167 @@ template <typename Result, typename ArgumentTuple> class InvokeHelper; template <typename R> -class InvokeHelper<R, ::testing::tuple<> > { +class InvokeHelper<R, ::std::tuple<> > { public: template <typename Function> - static R Invoke(Function function, const ::testing::tuple<>&) { + static R Invoke(Function function, const ::std::tuple<>&) { return function(); } template <class Class, typename MethodPtr> static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<>&) { + const ::std::tuple<>&) { return (obj_ptr->*method_ptr)(); } template <typename CallbackType> static R InvokeCallback(CallbackType* callback, - const ::testing::tuple<>&) { + const ::std::tuple<>&) { return callback->Run(); } }; template <typename R, typename A1> -class InvokeHelper<R, ::testing::tuple<A1> > { +class InvokeHelper<R, ::std::tuple<A1> > { public: template <typename Function> - static R Invoke(Function function, const ::testing::tuple<A1>& args) { - return function(get<0>(args)); + static R Invoke(Function function, const ::std::tuple<A1>& args) { + return function(std::get<0>(args)); } template <class Class, typename MethodPtr> static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<A1>& args) { - return (obj_ptr->*method_ptr)(get<0>(args)); + const ::std::tuple<A1>& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args)); } template <typename CallbackType> static R InvokeCallback(CallbackType* callback, - const ::testing::tuple<A1>& args) { - return callback->Run(get<0>(args)); + const ::std::tuple<A1>& args) { + return callback->Run(std::get<0>(args)); } }; template <typename R, typename A1, typename A2> -class InvokeHelper<R, ::testing::tuple<A1, A2> > { +class InvokeHelper<R, ::std::tuple<A1, A2> > { public: template <typename Function> - static R Invoke(Function function, const ::testing::tuple<A1, A2>& args) { - return function(get<0>(args), get<1>(args)); + static R Invoke(Function function, const ::std::tuple<A1, A2>& args) { + return function(std::get<0>(args), std::get<1>(args)); } template <class Class, typename MethodPtr> static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<A1, A2>& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args)); + const ::std::tuple<A1, A2>& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args)); } template <typename CallbackType> static R InvokeCallback(CallbackType* callback, - const ::testing::tuple<A1, A2>& args) { - return callback->Run(get<0>(args), get<1>(args)); + const ::std::tuple<A1, A2>& args) { + return callback->Run(std::get<0>(args), std::get<1>(args)); } }; template <typename R, typename A1, typename A2, typename A3> -class InvokeHelper<R, ::testing::tuple<A1, A2, A3> > { +class InvokeHelper<R, ::std::tuple<A1, A2, A3> > { public: template <typename Function> - static R Invoke(Function function, const ::testing::tuple<A1, A2, A3>& args) { - return function(get<0>(args), get<1>(args), get<2>(args)); + static R Invoke(Function function, const ::std::tuple<A1, A2, A3>& args) { + return function(std::get<0>(args), std::get<1>(args), + std::get<2>(args)); } template <class Class, typename MethodPtr> static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<A1, A2, A3>& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), - get<2>(args)); + const ::std::tuple<A1, A2, A3>& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args), + std::get<2>(args)); } template <typename CallbackType> static R InvokeCallback(CallbackType* callback, - const ::testing::tuple<A1, A2, A3>& args) { - return callback->Run(get<0>(args), get<1>(args), get<2>(args)); + const ::std::tuple<A1, A2, A3>& args) { + return callback->Run(std::get<0>(args), std::get<1>(args), + std::get<2>(args)); } }; template <typename R, typename A1, typename A2, typename A3, typename A4> -class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4> > { +class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4> > { public: template <typename Function> - static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, - A4>& args) { - return function(get<0>(args), get<1>(args), get<2>(args), - get<3>(args)); + static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4>& args) { + return function(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args)); } template <class Class, typename MethodPtr> static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<A1, A2, A3, A4>& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), - get<2>(args), get<3>(args)); + const ::std::tuple<A1, A2, A3, A4>& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args)); } template <typename CallbackType> static R InvokeCallback(CallbackType* callback, - const ::testing::tuple<A1, A2, A3, A4>& args) { - return callback->Run(get<0>(args), get<1>(args), get<2>(args), - get<3>(args)); + const ::std::tuple<A1, A2, A3, A4>& args) { + return callback->Run(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args)); } }; template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5> -class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5> > { +class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4, A5> > { public: template <typename Function> - static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, + static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4, A5>& args) { - return function(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args)); + return function(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args)); } template <class Class, typename MethodPtr> static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<A1, A2, A3, A4, A5>& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), - get<2>(args), get<3>(args), get<4>(args)); + const ::std::tuple<A1, A2, A3, A4, A5>& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args)); } template <typename CallbackType> static R InvokeCallback(CallbackType* callback, - const ::testing::tuple<A1, A2, A3, A4, A5>& args) { - return callback->Run(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args)); + const ::std::tuple<A1, A2, A3, A4, A5>& args) { + return callback->Run(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args)); } }; template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> -class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6> > { +class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4, A5, A6> > { public: template <typename Function> - static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5, + static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4, A5, A6>& args) { - return function(get<0>(args), get<1>(args), get<2>(args), - get<3>(args), get<4>(args), get<5>(args)); + return function(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args), + std::get<5>(args)); } template <class Class, typename MethodPtr> static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<A1, A2, A3, A4, A5, A6>& args) { - return (obj_ptr->*method_ptr)(get<0>(args), get<1>(args), - get<2>(args), get<3>(args), get<4>(args), get<5>(args)); + const ::std::tuple<A1, A2, A3, A4, A5, A6>& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args), + std::get<5>(args)); } // There is no InvokeCallback() for 6-tuples @@ -219,23 +224,23 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6> > { template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> -class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > { +class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4, A5, A6, A7> > { public: template <typename Function> - static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5, - A6, A7>& args) { - 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 ::std::tuple<A1, A2, A3, A4, A5, A6, + A7>& args) { + return function(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args), + std::get<5>(args), std::get<6>(args)); } template <class Class, typename MethodPtr> static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<A1, A2, A3, A4, A5, A6, - A7>& 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)); + const ::std::tuple<A1, A2, A3, A4, A5, A6, A7>& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args), + std::get<5>(args), std::get<6>(args)); } // There is no InvokeCallback() for 7-tuples @@ -243,24 +248,24 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > { template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> -class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > { +class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > { public: template <typename Function> - static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5, - A6, A7, A8>& 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)); + static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4, A5, A6, + A7, A8>& args) { + return function(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args), + std::get<5>(args), std::get<6>(args), std::get<7>(args)); } template <class Class, typename MethodPtr> static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, + const ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8>& 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)); + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args), + std::get<5>(args), std::get<6>(args), std::get<7>(args)); } // There is no InvokeCallback() for 8-tuples @@ -268,24 +273,26 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > { template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> -class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > { +class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > { public: template <typename Function> - static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5, - A6, A7, A8, A9>& 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)); + static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4, A5, A6, + A7, A8, A9>& args) { + return function(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args), + std::get<5>(args), std::get<6>(args), std::get<7>(args), + std::get<8>(args)); } template <class Class, typename MethodPtr> static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, + const ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9>& 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)); + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args), + std::get<5>(args), std::get<6>(args), std::get<7>(args), + std::get<8>(args)); } // There is no InvokeCallback() for 9-tuples @@ -294,25 +301,26 @@ class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > { template <typename R, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10> -class InvokeHelper<R, ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, - A10> > { +class InvokeHelper<R, ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> > { public: template <typename Function> - static R Invoke(Function function, const ::testing::tuple<A1, A2, A3, A4, A5, - A6, A7, A8, A9, A10>& 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)); + static R Invoke(Function function, const ::std::tuple<A1, A2, A3, A4, A5, A6, + A7, A8, A9, A10>& args) { + return function(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args), + std::get<5>(args), std::get<6>(args), std::get<7>(args), + std::get<8>(args), std::get<9>(args)); } template <class Class, typename MethodPtr> static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, - A9, A10>& 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)); + const ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, + A10>& args) { + return (obj_ptr->*method_ptr)(std::get<0>(args), std::get<1>(args), + std::get<2>(args), std::get<3>(args), std::get<4>(args), + std::get<5>(args), std::get<6>(args), std::get<7>(args), + std::get<8>(args), std::get<9>(args)); } // There is no InvokeCallback() for 10-tuples @@ -346,20 +354,20 @@ class InvokeCallbackAction { // 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 ::testing::tuple_element<N, Tuple>::type + typename ::std::tuple_element<N, Tuple>::type // SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::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<int, ::testing::tuple<bool, char, double, long>, 0, 3>::type +// SelectArgs<int, ::std::tuple<bool, char, double, long>, 0, 3>::type // is int(bool, long). // // SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args) // returns the selected fields (k1, k2, ..., k_n) of args as a tuple. // For example, -// SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select( -// ::testing::make_tuple(true, 'a', 2.5)) +// SelectArgs<int, std::tuple<bool, char, double>, 2, 0>::Select( +// ::std::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 @@ -378,9 +386,10 @@ class SelectArgs { GMOCK_FIELD_(ArgumentTuple, k10)); typedef typename Function<type>::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args), - get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args), - get<k8>(args), get<k9>(args), get<k10>(args)); + return SelectedArgs(std::get<k1>(args), std::get<k2>(args), + std::get<k3>(args), std::get<k4>(args), std::get<k5>(args), + std::get<k6>(args), std::get<k7>(args), std::get<k8>(args), + std::get<k9>(args), std::get<k10>(args)); } }; @@ -402,7 +411,7 @@ class SelectArgs<Result, ArgumentTuple, typedef Result type(GMOCK_FIELD_(ArgumentTuple, k1)); typedef typename Function<type>::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get<k1>(args)); + return SelectedArgs(std::get<k1>(args)); } }; @@ -414,7 +423,7 @@ class SelectArgs<Result, ArgumentTuple, GMOCK_FIELD_(ArgumentTuple, k2)); typedef typename Function<type>::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get<k1>(args), get<k2>(args)); + return SelectedArgs(std::get<k1>(args), std::get<k2>(args)); } }; @@ -426,7 +435,8 @@ class SelectArgs<Result, ArgumentTuple, GMOCK_FIELD_(ArgumentTuple, k2), GMOCK_FIELD_(ArgumentTuple, k3)); typedef typename Function<type>::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args)); + return SelectedArgs(std::get<k1>(args), std::get<k2>(args), + std::get<k3>(args)); } }; @@ -440,8 +450,8 @@ class SelectArgs<Result, ArgumentTuple, GMOCK_FIELD_(ArgumentTuple, k4)); typedef typename Function<type>::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args), - get<k4>(args)); + return SelectedArgs(std::get<k1>(args), std::get<k2>(args), + std::get<k3>(args), std::get<k4>(args)); } }; @@ -455,8 +465,8 @@ class SelectArgs<Result, ArgumentTuple, GMOCK_FIELD_(ArgumentTuple, k4), GMOCK_FIELD_(ArgumentTuple, k5)); typedef typename Function<type>::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args), - get<k4>(args), get<k5>(args)); + return SelectedArgs(std::get<k1>(args), std::get<k2>(args), + std::get<k3>(args), std::get<k4>(args), std::get<k5>(args)); } }; @@ -471,8 +481,9 @@ class SelectArgs<Result, ArgumentTuple, GMOCK_FIELD_(ArgumentTuple, k6)); typedef typename Function<type>::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args), - get<k4>(args), get<k5>(args), get<k6>(args)); + return SelectedArgs(std::get<k1>(args), std::get<k2>(args), + std::get<k3>(args), std::get<k4>(args), std::get<k5>(args), + std::get<k6>(args)); } }; @@ -487,8 +498,9 @@ class SelectArgs<Result, ArgumentTuple, GMOCK_FIELD_(ArgumentTuple, k6), GMOCK_FIELD_(ArgumentTuple, k7)); typedef typename Function<type>::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args), - get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args)); + return SelectedArgs(std::get<k1>(args), std::get<k2>(args), + std::get<k3>(args), std::get<k4>(args), std::get<k5>(args), + std::get<k6>(args), std::get<k7>(args)); } }; @@ -504,9 +516,9 @@ class SelectArgs<Result, ArgumentTuple, GMOCK_FIELD_(ArgumentTuple, k8)); typedef typename Function<type>::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args), - get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args), - get<k8>(args)); + return SelectedArgs(std::get<k1>(args), std::get<k2>(args), + std::get<k3>(args), std::get<k4>(args), std::get<k5>(args), + std::get<k6>(args), std::get<k7>(args), std::get<k8>(args)); } }; @@ -522,9 +534,10 @@ class SelectArgs<Result, ArgumentTuple, GMOCK_FIELD_(ArgumentTuple, k8), GMOCK_FIELD_(ArgumentTuple, k9)); typedef typename Function<type>::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs(get<k1>(args), get<k2>(args), get<k3>(args), - get<k4>(args), get<k5>(args), get<k6>(args), get<k7>(args), - get<k8>(args), get<k9>(args)); + return SelectedArgs(std::get<k1>(args), std::get<k2>(args), + std::get<k3>(args), std::get<k4>(args), std::get<k5>(args), + std::get<k6>(args), std::get<k7>(args), std::get<k8>(args), + std::get<k9>(args)); } }; @@ -587,7 +600,7 @@ struct ExcessiveArg {}; template <typename Result, class Impl> class ActionHelper { public: - static Result Perform(Impl* impl, const ::testing::tuple<>& args) { + static Result Perform(Impl* impl, const ::std::tuple<>& args) { return impl->template gmock_PerformImpl<>(args, ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), @@ -595,95 +608,96 @@ class ActionHelper { } template <typename A0> - static Result Perform(Impl* impl, const ::testing::tuple<A0>& args) { - return impl->template gmock_PerformImpl<A0>(args, get<0>(args), + static Result Perform(Impl* impl, const ::std::tuple<A0>& args) { + return impl->template gmock_PerformImpl<A0>(args, std::get<0>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template <typename A0, typename A1> - static Result Perform(Impl* impl, const ::testing::tuple<A0, A1>& args) { - return impl->template gmock_PerformImpl<A0, A1>(args, get<0>(args), - get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + static Result Perform(Impl* impl, const ::std::tuple<A0, A1>& args) { + return impl->template gmock_PerformImpl<A0, A1>(args, std::get<0>(args), + std::get<1>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template <typename A0, typename A1, typename A2> - static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2>& args) { - return impl->template gmock_PerformImpl<A0, A1, A2>(args, get<0>(args), - get<1>(args), get<2>(args), ExcessiveArg(), ExcessiveArg(), + static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2>& args) { + return impl->template gmock_PerformImpl<A0, A1, A2>(args, + std::get<0>(args), std::get<1>(args), std::get<2>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg()); + ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template <typename A0, typename A1, typename A2, typename A3> - static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, - A3>& args) { - return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args, get<0>(args), - get<1>(args), get<2>(args), get<3>(args), ExcessiveArg(), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg()); + static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3>& args) { + return impl->template gmock_PerformImpl<A0, A1, A2, A3>(args, + std::get<0>(args), std::get<1>(args), std::get<2>(args), + std::get<3>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template <typename A0, typename A1, typename A2, typename A3, typename A4> - static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, + static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4>& args) { return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4>(args, - get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), - ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg()); + std::get<0>(args), std::get<1>(args), std::get<2>(args), + std::get<3>(args), std::get<4>(args), ExcessiveArg(), ExcessiveArg(), + ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5> - static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4, + static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5>& args) { return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5>(args, - get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), - get<5>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg()); + std::get<0>(args), std::get<1>(args), std::get<2>(args), + std::get<3>(args), std::get<4>(args), std::get<5>(args), + ExcessiveArg(), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> - static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4, - A5, A6>& args) { + static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5, + A6>& args) { return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6>(args, - get<0>(args), get<1>(args), get<2>(args), get<3>(args), get<4>(args), - get<5>(args), get<6>(args), ExcessiveArg(), ExcessiveArg(), - ExcessiveArg()); + std::get<0>(args), std::get<1>(args), std::get<2>(args), + std::get<3>(args), std::get<4>(args), std::get<5>(args), + std::get<6>(args), ExcessiveArg(), ExcessiveArg(), ExcessiveArg()); } template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> - static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4, - A5, A6, A7>& args) { + static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5, + A6, A7>& args) { return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, - A7>(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(), - ExcessiveArg()); + A7>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args), + std::get<3>(args), std::get<4>(args), std::get<5>(args), + std::get<6>(args), std::get<7>(args), ExcessiveArg(), ExcessiveArg()); } template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> - static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4, - A5, A6, A7, A8>& args) { + static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5, + A6, A7, A8>& args) { return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, - A8>(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), + A8>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args), + std::get<3>(args), std::get<4>(args), std::get<5>(args), + std::get<6>(args), std::get<7>(args), std::get<8>(args), ExcessiveArg()); } template <typename A0, typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> - static Result Perform(Impl* impl, const ::testing::tuple<A0, A1, A2, A3, A4, - A5, A6, A7, A8, A9>& args) { + static Result Perform(Impl* impl, const ::std::tuple<A0, A1, A2, A3, A4, A5, + A6, A7, A8, A9>& args) { return impl->template gmock_PerformImpl<A0, A1, A2, A3, A4, A5, A6, A7, A8, - A9>(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), - get<9>(args)); + A9>(args, std::get<0>(args), std::get<1>(args), std::get<2>(args), + std::get<3>(args), std::get<4>(args), std::get<5>(args), + std::get<6>(args), std::get<7>(args), std::get<8>(args), + std::get<9>(args)); } }; @@ -950,8 +964,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, // // MORE INFORMATION: // -// To learn more about using these macros, please search for 'ACTION' -// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md +// To learn more about using these macros, please search for 'ACTION' on +// https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md // An internal macro needed for implementing ACTION*(). #define GMOCK_ACTION_ARG_TYPES_AND_NAMES_UNUSED_\ @@ -991,7 +1005,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(::testing::get<k>(args)); +// *output = T(::std::get<k>(args)); // } // ... // int n; @@ -1149,90 +1163,67 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, #define GMOCK_INTERNAL_INIT_AND_0_VALUE_PARAMS()\ () #define GMOCK_INTERNAL_INIT_AND_1_VALUE_PARAMS(p0)\ - (p0##_type gmock_p0) : p0(::testing::internal::move(gmock_p0)) + (p0##_type gmock_p0) : p0(::std::move(gmock_p0)) #define GMOCK_INTERNAL_INIT_AND_2_VALUE_PARAMS(p0, p1)\ - (p0##_type gmock_p0, \ - p1##_type gmock_p1) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)) + (p0##_type gmock_p0, p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)) #define GMOCK_INTERNAL_INIT_AND_3_VALUE_PARAMS(p0, p1, p2)\ (p0##_type gmock_p0, p1##_type gmock_p1, \ - p2##_type gmock_p2) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)) + p2##_type gmock_p2) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)) #define GMOCK_INTERNAL_INIT_AND_4_VALUE_PARAMS(p0, p1, p2, p3)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ - p3##_type gmock_p3) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)) + p3##_type gmock_p3) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)) #define GMOCK_INTERNAL_INIT_AND_5_VALUE_PARAMS(p0, p1, p2, p3, p4)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ - p3##_type gmock_p3, \ - p4##_type gmock_p4) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)) + p3##_type gmock_p3, p4##_type gmock_p4) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)) #define GMOCK_INTERNAL_INIT_AND_6_VALUE_PARAMS(p0, p1, p2, p3, p4, p5)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, \ - p5##_type gmock_p5) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)) + p5##_type gmock_p5) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)) #define GMOCK_INTERNAL_INIT_AND_7_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ - p6##_type gmock_p6) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)) + p6##_type gmock_p6) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)) #define GMOCK_INTERNAL_INIT_AND_8_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, p7)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ - p6##_type gmock_p6, \ - p7##_type gmock_p7) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)) + p6##_type gmock_p6, p7##_type gmock_p7) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ + p7(::std::move(gmock_p7)) #define GMOCK_INTERNAL_INIT_AND_9_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ p7, p8)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7, \ - p8##_type gmock_p8) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)), \ - p8(::testing::internal::move(gmock_p8)) + p8##_type gmock_p8) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ + p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)) #define GMOCK_INTERNAL_INIT_AND_10_VALUE_PARAMS(p0, p1, p2, p3, p4, p5, p6, \ p7, p8, p9)\ (p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \ - p9##_type gmock_p9) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)), \ - p8(::testing::internal::move(gmock_p8)), \ - p9(::testing::internal::move(gmock_p9)) + p9##_type gmock_p9) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ + p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)), \ + p9(::std::move(gmock_p9)) // Declares the fields for storing the value parameters. #define GMOCK_INTERNAL_DEFN_AND_0_VALUE_PARAMS() @@ -1469,7 +1460,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, class name##ActionP {\ public:\ explicit name##ActionP(p0##_type gmock_p0) : \ - p0(::testing::internal::forward<p0##_type>(gmock_p0)) {}\ + p0(::std::forward<p0##_type>(gmock_p0)) {}\ template <typename F>\ class gmock_Impl : public ::testing::ActionInterface<F> {\ public:\ @@ -1478,7 +1469,7 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, typedef typename ::testing::internal::Function<F>::ArgumentTuple\ args_type;\ explicit gmock_Impl(p0##_type gmock_p0) : \ - p0(::testing::internal::forward<p0##_type>(gmock_p0)) {}\ + p0(::std::forward<p0##_type>(gmock_p0)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ Perform(this, args);\ @@ -1521,8 +1512,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, class name##ActionP2 {\ public:\ name##ActionP2(p0##_type gmock_p0, \ - p1##_type gmock_p1) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)) {}\ + p1##_type gmock_p1) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)) {}\ template <typename F>\ class gmock_Impl : public ::testing::ActionInterface<F> {\ public:\ @@ -1531,8 +1522,8 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, typedef typename ::testing::internal::Function<F>::ArgumentTuple\ args_type;\ gmock_Impl(p0##_type gmock_p0, \ - p1##_type gmock_p1) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)) {}\ + p1##_type gmock_p1) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ Perform(this, args);\ @@ -1578,9 +1569,9 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, class name##ActionP3 {\ public:\ name##ActionP3(p0##_type gmock_p0, p1##_type gmock_p1, \ - p2##_type gmock_p2) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)) {}\ + p2##_type gmock_p2) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)) {}\ template <typename F>\ class gmock_Impl : public ::testing::ActionInterface<F> {\ public:\ @@ -1589,9 +1580,9 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, typedef typename ::testing::internal::Function<F>::ArgumentTuple\ args_type;\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, \ - p2##_type gmock_p2) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)) {}\ + p2##_type gmock_p2) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ Perform(this, args);\ @@ -1642,10 +1633,10 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, public:\ name##ActionP4(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, \ - p3##_type gmock_p3) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)) {}\ + p3##_type gmock_p3) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)) {}\ template <typename F>\ class gmock_Impl : public ::testing::ActionInterface<F> {\ public:\ @@ -1654,10 +1645,10 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, typedef typename ::testing::internal::Function<F>::ArgumentTuple\ args_type;\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ - p3##_type gmock_p3) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)) {}\ + p3##_type gmock_p3) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ Perform(this, args);\ @@ -1714,11 +1705,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, public:\ name##ActionP5(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, \ - p4##_type gmock_p4) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ - p4(::testing::internal::forward<p4##_type>(gmock_p4)) {}\ + p4##_type gmock_p4) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)), \ + p4(::std::forward<p4##_type>(gmock_p4)) {}\ template <typename F>\ class gmock_Impl : public ::testing::ActionInterface<F> {\ public:\ @@ -1728,11 +1719,11 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, args_type;\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, \ - p4##_type gmock_p4) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ - p4(::testing::internal::forward<p4##_type>(gmock_p4)) {}\ + p4##_type gmock_p4) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)), \ + p4(::std::forward<p4##_type>(gmock_p4)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ Perform(this, args);\ @@ -1791,12 +1782,12 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, public:\ name##ActionP6(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ - p5##_type gmock_p5) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ - p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ - p5(::testing::internal::forward<p5##_type>(gmock_p5)) {}\ + p5##_type gmock_p5) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)), \ + p4(::std::forward<p4##_type>(gmock_p4)), \ + p5(::std::forward<p5##_type>(gmock_p5)) {}\ template <typename F>\ class gmock_Impl : public ::testing::ActionInterface<F> {\ public:\ @@ -1806,12 +1797,12 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, args_type;\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, \ - p5##_type gmock_p5) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ - p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ - p5(::testing::internal::forward<p5##_type>(gmock_p5)) {}\ + p5##_type gmock_p5) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)), \ + p4(::std::forward<p4##_type>(gmock_p4)), \ + p5(::std::forward<p5##_type>(gmock_p5)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ Perform(this, args);\ @@ -1874,13 +1865,13 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, name##ActionP7(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, \ - p6##_type gmock_p6) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ - p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ - p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ - p6(::testing::internal::forward<p6##_type>(gmock_p6)) {}\ + p6##_type gmock_p6) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)), \ + p4(::std::forward<p4##_type>(gmock_p4)), \ + p5(::std::forward<p5##_type>(gmock_p5)), \ + p6(::std::forward<p6##_type>(gmock_p6)) {}\ template <typename F>\ class gmock_Impl : public ::testing::ActionInterface<F> {\ public:\ @@ -1890,13 +1881,13 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, args_type;\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ - p6##_type gmock_p6) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ - p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ - p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ - p6(::testing::internal::forward<p6##_type>(gmock_p6)) {}\ + p6##_type gmock_p6) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)), \ + p4(::std::forward<p4##_type>(gmock_p4)), \ + p5(::std::forward<p5##_type>(gmock_p5)), \ + p6(::std::forward<p6##_type>(gmock_p6)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ Perform(this, args);\ @@ -1965,14 +1956,14 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, name##ActionP8(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, p6##_type gmock_p6, \ - p7##_type gmock_p7) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ - p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ - p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ - p6(::testing::internal::forward<p6##_type>(gmock_p6)), \ - p7(::testing::internal::forward<p7##_type>(gmock_p7)) {}\ + p7##_type gmock_p7) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)), \ + p4(::std::forward<p4##_type>(gmock_p4)), \ + p5(::std::forward<p5##_type>(gmock_p5)), \ + p6(::std::forward<p6##_type>(gmock_p6)), \ + p7(::std::forward<p7##_type>(gmock_p7)) {}\ template <typename F>\ class gmock_Impl : public ::testing::ActionInterface<F> {\ public:\ @@ -1983,14 +1974,14 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, \ - p7##_type gmock_p7) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ - p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ - p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ - p6(::testing::internal::forward<p6##_type>(gmock_p6)), \ - p7(::testing::internal::forward<p7##_type>(gmock_p7)) {}\ + p7##_type gmock_p7) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)), \ + p4(::std::forward<p4##_type>(gmock_p4)), \ + p5(::std::forward<p5##_type>(gmock_p5)), \ + p6(::std::forward<p6##_type>(gmock_p6)), \ + p7(::std::forward<p7##_type>(gmock_p7)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ Perform(this, args);\ @@ -2063,15 +2054,15 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, name##ActionP9(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ - p8##_type gmock_p8) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ - p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ - p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ - p6(::testing::internal::forward<p6##_type>(gmock_p6)), \ - p7(::testing::internal::forward<p7##_type>(gmock_p7)), \ - p8(::testing::internal::forward<p8##_type>(gmock_p8)) {}\ + p8##_type gmock_p8) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)), \ + p4(::std::forward<p4##_type>(gmock_p4)), \ + p5(::std::forward<p5##_type>(gmock_p5)), \ + p6(::std::forward<p6##_type>(gmock_p6)), \ + p7(::std::forward<p7##_type>(gmock_p7)), \ + p8(::std::forward<p8##_type>(gmock_p8)) {}\ template <typename F>\ class gmock_Impl : public ::testing::ActionInterface<F> {\ public:\ @@ -2082,15 +2073,15 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7, \ - p8##_type gmock_p8) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ - p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ - p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ - p6(::testing::internal::forward<p6##_type>(gmock_p6)), \ - p7(::testing::internal::forward<p7##_type>(gmock_p7)), \ - p8(::testing::internal::forward<p8##_type>(gmock_p8)) {}\ + p8##_type gmock_p8) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)), \ + p4(::std::forward<p4##_type>(gmock_p4)), \ + p5(::std::forward<p5##_type>(gmock_p5)), \ + p6(::std::forward<p6##_type>(gmock_p6)), \ + p7(::std::forward<p7##_type>(gmock_p7)), \ + p8(::std::forward<p8##_type>(gmock_p8)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ Perform(this, args);\ @@ -2168,16 +2159,16 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ p8##_type gmock_p8, \ - p9##_type gmock_p9) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ - p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ - p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ - p6(::testing::internal::forward<p6##_type>(gmock_p6)), \ - p7(::testing::internal::forward<p7##_type>(gmock_p7)), \ - p8(::testing::internal::forward<p8##_type>(gmock_p8)), \ - p9(::testing::internal::forward<p9##_type>(gmock_p9)) {}\ + p9##_type gmock_p9) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)), \ + p4(::std::forward<p4##_type>(gmock_p4)), \ + p5(::std::forward<p5##_type>(gmock_p5)), \ + p6(::std::forward<p6##_type>(gmock_p6)), \ + p7(::std::forward<p7##_type>(gmock_p7)), \ + p8(::std::forward<p8##_type>(gmock_p8)), \ + p9(::std::forward<p9##_type>(gmock_p9)) {}\ template <typename F>\ class gmock_Impl : public ::testing::ActionInterface<F> {\ public:\ @@ -2188,16 +2179,16 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6, gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \ - p9##_type gmock_p9) : p0(::testing::internal::forward<p0##_type>(gmock_p0)), \ - p1(::testing::internal::forward<p1##_type>(gmock_p1)), \ - p2(::testing::internal::forward<p2##_type>(gmock_p2)), \ - p3(::testing::internal::forward<p3##_type>(gmock_p3)), \ - p4(::testing::internal::forward<p4##_type>(gmock_p4)), \ - p5(::testing::internal::forward<p5##_type>(gmock_p5)), \ - p6(::testing::internal::forward<p6##_type>(gmock_p6)), \ - p7(::testing::internal::forward<p7##_type>(gmock_p7)), \ - p8(::testing::internal::forward<p8##_type>(gmock_p8)), \ - p9(::testing::internal::forward<p9##_type>(gmock_p9)) {}\ + p9##_type gmock_p9) : p0(::std::forward<p0##_type>(gmock_p0)), \ + p1(::std::forward<p1##_type>(gmock_p1)), \ + p2(::std::forward<p2##_type>(gmock_p2)), \ + p3(::std::forward<p3##_type>(gmock_p3)), \ + p4(::std::forward<p4##_type>(gmock_p4)), \ + p5(::std::forward<p5##_type>(gmock_p5)), \ + p6(::std::forward<p6##_type>(gmock_p6)), \ + p7(::std::forward<p7##_type>(gmock_p7)), \ + p8(::std::forward<p8##_type>(gmock_p8)), \ + p9(::std::forward<p9##_type>(gmock_p9)) {}\ virtual return_type Perform(const args_type& args) {\ return ::testing::internal::ActionHelper<return_type, gmock_Impl>::\ Perform(this, args);\ @@ -2389,7 +2380,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl<return_type>( internal::invoke_argument::AdlTag(), - ::testing::get<k>(args)); + ::std::get<k>(args)); } ACTION_TEMPLATE(InvokeArgument, @@ -2398,7 +2389,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl<return_type>( internal::invoke_argument::AdlTag(), - ::testing::get<k>(args), p0); + ::std::get<k>(args), p0); } ACTION_TEMPLATE(InvokeArgument, @@ -2407,7 +2398,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl<return_type>( internal::invoke_argument::AdlTag(), - ::testing::get<k>(args), p0, p1); + ::std::get<k>(args), p0, p1); } ACTION_TEMPLATE(InvokeArgument, @@ -2416,7 +2407,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl<return_type>( internal::invoke_argument::AdlTag(), - ::testing::get<k>(args), p0, p1, p2); + ::std::get<k>(args), p0, p1, p2); } ACTION_TEMPLATE(InvokeArgument, @@ -2425,7 +2416,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl<return_type>( internal::invoke_argument::AdlTag(), - ::testing::get<k>(args), p0, p1, p2, p3); + ::std::get<k>(args), p0, p1, p2, p3); } ACTION_TEMPLATE(InvokeArgument, @@ -2434,7 +2425,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl<return_type>( internal::invoke_argument::AdlTag(), - ::testing::get<k>(args), p0, p1, p2, p3, p4); + ::std::get<k>(args), p0, p1, p2, p3, p4); } ACTION_TEMPLATE(InvokeArgument, @@ -2443,7 +2434,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl<return_type>( internal::invoke_argument::AdlTag(), - ::testing::get<k>(args), p0, p1, p2, p3, p4, p5); + ::std::get<k>(args), p0, p1, p2, p3, p4, p5); } ACTION_TEMPLATE(InvokeArgument, @@ -2452,7 +2443,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl<return_type>( internal::invoke_argument::AdlTag(), - ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6); + ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6); } ACTION_TEMPLATE(InvokeArgument, @@ -2461,7 +2452,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl<return_type>( internal::invoke_argument::AdlTag(), - ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7); + ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7); } ACTION_TEMPLATE(InvokeArgument, @@ -2470,7 +2461,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl<return_type>( internal::invoke_argument::AdlTag(), - ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8); + ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8); } ACTION_TEMPLATE(InvokeArgument, @@ -2479,7 +2470,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl<return_type>( internal::invoke_argument::AdlTag(), - ::testing::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); + ::std::get<k>(args), p0, p1, p2, p3, p4, p5, p6, p7, p8, p9); } // Various overloads for ReturnNew<T>(). diff --git a/googlemock/include/gmock/gmock-generated-actions.h.pump b/googlemock/include/gmock/gmock-generated-actions.h.pump index f1ee4a61..bc22be8e 100644 --- a/googlemock/include/gmock/gmock-generated-actions.h.pump +++ b/googlemock/include/gmock/gmock-generated-actions.h.pump @@ -43,6 +43,8 @@ $$}} This meta comment fixes auto-indentation in editors. #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_ACTIONS_H_ +#include <utility> + #include "gmock/gmock-actions.h" #include "gmock/internal/gmock-port.h" @@ -63,19 +65,19 @@ $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 gets = [[$for j, [[get<$(j - 1)>(args)]]]] +$var gets = [[$for j, [[std::get<$(j - 1)>(args)]]]] template <typename R$types> -class InvokeHelper<R, ::testing::tuple<$as> > { +class InvokeHelper<R, ::std::tuple<$as> > { public: template <typename Function> - static R Invoke(Function function, const ::testing::tuple<$as>&$args) { + static R Invoke(Function function, const ::std::tuple<$as>&$args) { return function($gets); } template <class Class, typename MethodPtr> static R InvokeMethod(Class* obj_ptr, MethodPtr method_ptr, - const ::testing::tuple<$as>&$args) { + const ::std::tuple<$as>&$args) { return (obj_ptr->*method_ptr)($gets); } @@ -83,7 +85,7 @@ class InvokeHelper<R, ::testing::tuple<$as> > { $if i <= max_callback_arity [[ template <typename CallbackType> static R InvokeCallback(CallbackType* callback, - const ::testing::tuple<$as>&$args) { + const ::std::tuple<$as>&$args) { return callback->Run($gets); } ]] $else [[ @@ -122,7 +124,7 @@ class InvokeCallbackAction { // 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 ::testing::tuple_element<N, Tuple>::type + typename ::std::tuple_element<N, Tuple>::type $range i 1..n @@ -130,14 +132,14 @@ $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<int, ::testing::tuple<bool, char, double, long>, 0, 3>::type +// SelectArgs<int, ::std::tuple<bool, char, double, long>, 0, 3>::type // is int(bool, long). // // SelectArgs<Result, ArgumentTuple, k1, k2, ..., k_n>::Select(args) // returns the selected fields (k1, k2, ..., k_n) of args as a tuple. // For example, -// SelectArgs<int, tuple<bool, char, double>, 2, 0>::Select( -// ::testing::make_tuple(true, 'a', 2.5)) +// SelectArgs<int, std::tuple<bool, char, double>, 2, 0>::Select( +// ::std::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 @@ -150,7 +152,7 @@ class SelectArgs { typedef Result type($for i, [[GMOCK_FIELD_(ArgumentTuple, k$i)]]); typedef typename Function<type>::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& args) { - return SelectedArgs($for i, [[get<k$i>(args)]]); + return SelectedArgs($for i, [[std::get<k$i>(args)]]); } }; @@ -166,7 +168,7 @@ class SelectArgs<Result, ArgumentTuple, typedef typename Function<type>::ArgumentTuple SelectedArgs; static SelectedArgs Select(const ArgumentTuple& [[]] $if i == 1 [[/* args */]] $else [[args]]) { - return SelectedArgs($for j1, [[get<k$j1>(args)]]); + return SelectedArgs($for j1, [[std::get<k$j1>(args)]]); } }; @@ -240,12 +242,12 @@ $range j 0..i-1 ]]]] $range j 0..i-1 $var As = [[$for j, [[A$j]]]] -$var as = [[$for j, [[get<$j>(args)]]]] +$var as = [[$for j, [[std::get<$j>(args)]]]] $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 ::testing::tuple<$As>& args) { + static Result Perform(Impl* impl, const ::std::tuple<$As>& args) { return impl->template gmock_PerformImpl<$As>(args, $arg_list); } @@ -395,8 +397,8 @@ $range j2 2..i // // MORE INFORMATION: // -// To learn more about using these macros, please search for 'ACTION' -// on https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md +// To learn more about using these macros, please search for 'ACTION' on +// https://github.com/google/googletest/blob/master/googlemock/docs/CookBook.md $range i 0..n $range k 0..n-1 @@ -432,7 +434,7 @@ $for k [[, \ // ACTION_TEMPLATE(DuplicateArg, // HAS_2_TEMPLATE_PARAMS(int, k, typename, T), // AND_1_VALUE_PARAMS(output)) { -// *output = T(::testing::get<k>(args)); +// *output = T(::std::get<k>(args)); // } // ... // int n; @@ -525,7 +527,7 @@ _VALUE_PARAMS($for j, [[p$j]]) $for j [[, typename p$j##_type]] $for i [[ $range j 0..i-1 #define GMOCK_INTERNAL_INIT_AND_$i[[]]_VALUE_PARAMS($for j, [[p$j]])\ - ($for j, [[p$j##_type gmock_p$j]])$if i>0 [[ : ]]$for j, [[p$j(::testing::internal::move(gmock_p$j))]] + ($for j, [[p$j##_type gmock_p$j]])$if i>0 [[ : ]]$for j, [[p$j(::std::move(gmock_p$j))]] ]] @@ -658,7 +660,7 @@ $var class_name = [[name##Action[[$if i==0 [[]] $elif i==1 [[P]] $range j 0..i-1 $var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] $var param_types_and_names = [[$for j, [[p$j##_type p$j]]]] -$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::testing::internal::forward<p$j##_type>(gmock_p$j))]]]]]] +$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::std::forward<p$j##_type>(gmock_p$j))]]]]]] $var param_field_decls = [[$for j [[ @@ -796,7 +798,7 @@ ACTION_TEMPLATE(InvokeArgument, using internal::invoke_argument::InvokeArgumentAdl; return InvokeArgumentAdl<return_type>( internal::invoke_argument::AdlTag(), - ::testing::get<k>(args)$for j [[, p$j]]); + ::std::get<k>(args)$for j [[, p$j]]); } ]] diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h b/googlemock/include/gmock/gmock-generated-function-mockers.h index aab45820..38a7d15d 100644 --- a/googlemock/include/gmock/gmock-generated-function-mockers.h +++ b/googlemock/include/gmock/gmock-generated-function-mockers.h @@ -41,6 +41,8 @@ #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ +#include <utility> + #include "gmock/gmock-spec-builders.h" #include "gmock/internal/gmock-internal-utils.h" @@ -70,7 +72,7 @@ class FunctionMocker<R()> : public typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple; MockSpec<F> With() { - return MockSpec<F>(this, ::testing::make_tuple()); + return MockSpec<F>(this, ::std::make_tuple()); } R Invoke() { @@ -90,7 +92,7 @@ class FunctionMocker<R(A1)> : public typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple; MockSpec<F> With(const Matcher<A1>& m1) { - return MockSpec<F>(this, ::testing::make_tuple(m1)); + return MockSpec<F>(this, ::std::make_tuple(m1)); } R Invoke(A1 a1) { @@ -98,7 +100,7 @@ class FunctionMocker<R(A1)> : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1))); + return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1))); } }; @@ -110,7 +112,7 @@ class FunctionMocker<R(A1, A2)> : public typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple; MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2) { - return MockSpec<F>(this, ::testing::make_tuple(m1, m2)); + return MockSpec<F>(this, ::std::make_tuple(m1, m2)); } R Invoke(A1 a1, A2 a2) { @@ -118,8 +120,8 @@ class FunctionMocker<R(A1, A2)> : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), - internal::forward<A2>(a2))); + return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1), + std::forward<A2>(a2))); } }; @@ -132,7 +134,7 @@ class FunctionMocker<R(A1, A2, A3)> : public MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2, const Matcher<A3>& m3) { - return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3)); + return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3)); } R Invoke(A1 a1, A2 a2, A3 a3) { @@ -140,8 +142,8 @@ class FunctionMocker<R(A1, A2, A3)> : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), - internal::forward<A2>(a2), internal::forward<A3>(a3))); + return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1), + std::forward<A2>(a2), std::forward<A3>(a3))); } }; @@ -154,7 +156,7 @@ class FunctionMocker<R(A1, A2, A3, A4)> : public MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2, const Matcher<A3>& m3, const Matcher<A4>& m4) { - return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4)); + return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4) { @@ -162,9 +164,8 @@ class FunctionMocker<R(A1, A2, A3, A4)> : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), - internal::forward<A2>(a2), internal::forward<A3>(a3), - internal::forward<A4>(a4))); + return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1), + std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4))); } }; @@ -178,7 +179,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5)> : public MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2, const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5) { - return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5)); + return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4, m5)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) { @@ -186,9 +187,9 @@ class FunctionMocker<R(A1, A2, A3, A4, A5)> : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), - internal::forward<A2>(a2), internal::forward<A3>(a3), - internal::forward<A4>(a4), internal::forward<A5>(a5))); + return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1), + std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4), + std::forward<A5>(a5))); } }; @@ -203,7 +204,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2, const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5, const Matcher<A6>& m6) { - return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6)); + return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) { @@ -211,10 +212,9 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6)> : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), - internal::forward<A2>(a2), internal::forward<A3>(a3), - internal::forward<A4>(a4), internal::forward<A5>(a5), - internal::forward<A6>(a6))); + return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1), + std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4), + std::forward<A5>(a5), std::forward<A6>(a6))); } }; @@ -229,7 +229,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2, const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5, const Matcher<A6>& m6, const Matcher<A7>& m7) { - return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7)); + return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6, m7)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) { @@ -237,10 +237,9 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7)> : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), - internal::forward<A2>(a2), internal::forward<A3>(a3), - internal::forward<A4>(a4), internal::forward<A5>(a5), - internal::forward<A6>(a6), internal::forward<A7>(a7))); + return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1), + std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4), + std::forward<A5>(a5), std::forward<A6>(a6), std::forward<A7>(a7))); } }; @@ -255,8 +254,7 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public MockSpec<F> With(const Matcher<A1>& m1, const Matcher<A2>& m2, const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5, const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8) { - return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7, - m8)); + return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6, m7, m8)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8) { @@ -264,11 +262,10 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8)> : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), - internal::forward<A2>(a2), internal::forward<A3>(a3), - internal::forward<A4>(a4), internal::forward<A5>(a5), - internal::forward<A6>(a6), internal::forward<A7>(a7), - internal::forward<A8>(a8))); + return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1), + std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4), + std::forward<A5>(a5), std::forward<A6>(a6), std::forward<A7>(a7), + std::forward<A8>(a8))); } }; @@ -284,8 +281,8 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5, const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8, const Matcher<A9>& m9) { - return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7, - m8, m9)); + return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6, m7, m8, + m9)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9) { @@ -293,11 +290,10 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), - internal::forward<A2>(a2), internal::forward<A3>(a3), - internal::forward<A4>(a4), internal::forward<A5>(a5), - internal::forward<A6>(a6), internal::forward<A7>(a7), - internal::forward<A8>(a8), internal::forward<A9>(a9))); + return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1), + std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4), + std::forward<A5>(a5), std::forward<A6>(a6), std::forward<A7>(a7), + std::forward<A8>(a8), std::forward<A9>(a9))); } }; @@ -314,8 +310,8 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public const Matcher<A3>& m3, const Matcher<A4>& m4, const Matcher<A5>& m5, const Matcher<A6>& m6, const Matcher<A7>& m7, const Matcher<A8>& m8, const Matcher<A9>& m9, const Matcher<A10>& m10) { - return MockSpec<F>(this, ::testing::make_tuple(m1, m2, m3, m4, m5, m6, m7, - m8, m9, m10)); + return MockSpec<F>(this, ::std::make_tuple(m1, m2, m3, m4, m5, m6, m7, m8, + m9, m10)); } R Invoke(A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9, @@ -324,12 +320,10 @@ class FunctionMocker<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : public // by the C++ standard [14.6.4] here, as the base class type is // dependent on the template argument (and thus shouldn't be // looked into when resolving InvokeWith). - return this->InvokeWith(ArgumentTuple(internal::forward<A1>(a1), - internal::forward<A2>(a2), internal::forward<A3>(a3), - internal::forward<A4>(a4), internal::forward<A5>(a5), - internal::forward<A6>(a6), internal::forward<A7>(a7), - internal::forward<A8>(a8), internal::forward<A9>(a9), - internal::forward<A10>(a10))); + return this->InvokeWith(ArgumentTuple(std::forward<A1>(a1), + std::forward<A2>(a2), std::forward<A3>(a3), std::forward<A4>(a4), + std::forward<A5>(a5), std::forward<A6>(a6), std::forward<A7>(a7), + std::forward<A8>(a8), std::forward<A9>(a9), std::forward<A10>(a10))); } }; @@ -418,534 +412,478 @@ using internal::FunctionMocker; GTEST_CONCAT_TOKEN_(gmock##constness##arity##_##Method##_, __LINE__) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) ct Method() constness { \ - GTEST_COMPILE_ASSERT_( \ - (::testing::tuple_size<tn ::testing::internal::Function< \ - __VA_ARGS__>::ArgumentTuple>::value == 0), \ - this_method_does_not_take_0_arguments); \ - GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(0, constness, Method).Invoke(); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method() constness { \ - GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(0, constness, Method).With(); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(); \ - } \ +#define GMOCK_METHOD0_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + ) constness { \ + GTEST_COMPILE_ASSERT_((::std::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 0), \ + this_method_does_not_take_0_arguments); \ + GMOCK_MOCKER_(0, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(0, constness, Method).Invoke(); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method() constness { \ + GMOCK_MOCKER_(0, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(0, constness, Method).With(); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(); \ + } \ mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(0, constness, \ - Method) + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#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_( \ - (::testing::tuple_size<tn ::testing::internal::Function< \ - __VA_ARGS__>::ArgumentTuple>::value == 1), \ - this_method_does_not_take_1_argument); \ - GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(1, constness, Method) \ - .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ - gmock_a1)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ - GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \ - Method) +#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::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 1), \ + this_method_does_not_take_1_argument); \ + GMOCK_MOCKER_(1, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(1, constness, \ + Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ + __VA_ARGS__)>(gmock_a1)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1) constness { \ + GMOCK_MOCKER_(1, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(1, constness, Method).With(gmock_a1); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(1, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \ - 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_( \ - (::testing::tuple_size<tn ::testing::internal::Function< \ - __VA_ARGS__>::ArgumentTuple>::value == 2), \ - this_method_does_not_take_2_arguments); \ - GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(2, constness, Method) \ - .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ - gmock_a1), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ - gmock_a2)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \ - GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \ - Method) +#define GMOCK_METHOD2_(tn, constness, ct, Method, ...) \ + 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::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 2), \ + this_method_does_not_take_2_arguments); \ + GMOCK_MOCKER_(2, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(2, constness, \ + Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ + __VA_ARGS__)>(gmock_a1), \ + ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2) constness { \ + GMOCK_MOCKER_(2, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(2, constness, Method).With(gmock_a1, gmock_a2); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(2, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(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_( \ - (::testing::tuple_size<tn ::testing::internal::Function< \ - __VA_ARGS__>::ArgumentTuple>::value == 3), \ - this_method_does_not_take_3_arguments); \ - GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(3, constness, Method) \ - .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ - gmock_a1), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ - gmock_a2), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ - gmock_a3)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \ - GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(3, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \ - Method) +#define GMOCK_METHOD3_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + 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::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 3), \ + this_method_does_not_take_3_arguments); \ + GMOCK_MOCKER_(3, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(3, constness, \ + Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ + __VA_ARGS__)>(gmock_a1), \ + ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3) constness { \ + GMOCK_MOCKER_(3, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(3, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(3, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - 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_( \ - (::testing::tuple_size<tn ::testing::internal::Function< \ - __VA_ARGS__>::ArgumentTuple>::value == 4), \ - this_method_does_not_take_4_arguments); \ - GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(4, constness, Method) \ - .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ - gmock_a1), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ - gmock_a2), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ - gmock_a3), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ - gmock_a4)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ - GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(4, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \ - Method) +#define GMOCK_METHOD4_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, 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::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 4), \ + this_method_does_not_take_4_arguments); \ + GMOCK_MOCKER_(4, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(4, constness, \ + Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ + __VA_ARGS__)>(gmock_a1), \ + ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4) constness { \ + GMOCK_MOCKER_(4, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(4, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(4, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - 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_( \ - (::testing::tuple_size<tn ::testing::internal::Function< \ - __VA_ARGS__>::ArgumentTuple>::value == 5), \ - this_method_does_not_take_5_arguments); \ - GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(5, constness, Method) \ - .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ - gmock_a1), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ - gmock_a2), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ - gmock_a3), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ - gmock_a4), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \ - gmock_a5)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \ - GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(5, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \ - Method) +#define GMOCK_METHOD5_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, 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::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 5), \ + this_method_does_not_take_5_arguments); \ + GMOCK_MOCKER_(5, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(5, constness, \ + Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ + __VA_ARGS__)>(gmock_a1), \ + ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \ + ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5) constness { \ + GMOCK_MOCKER_(5, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(5, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(5, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ - 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_( \ - (::testing::tuple_size<tn ::testing::internal::Function< \ - __VA_ARGS__>::ArgumentTuple>::value == 6), \ - this_method_does_not_take_6_arguments); \ - GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(6, constness, Method) \ - .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ - gmock_a1), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ - gmock_a2), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ - gmock_a3), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ - gmock_a4), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \ - gmock_a5), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \ - gmock_a6)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \ - GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(6, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \ - Method) +#define GMOCK_METHOD6_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + 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::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 6), \ + this_method_does_not_take_6_arguments); \ + GMOCK_MOCKER_(6, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(6, constness, \ + Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ + __VA_ARGS__)>(gmock_a1), \ + ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \ + ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \ + ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6) constness { \ + GMOCK_MOCKER_(6, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(6, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(6, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ - 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_( \ - (::testing::tuple_size<tn ::testing::internal::Function< \ - __VA_ARGS__>::ArgumentTuple>::value == 7), \ - this_method_does_not_take_7_arguments); \ - GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(7, constness, Method) \ - .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ - gmock_a1), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ - gmock_a2), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ - gmock_a3), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ - gmock_a4), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \ - gmock_a5), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \ - gmock_a6), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \ - gmock_a7)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ - GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ - GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(7, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \ - gmock_a7); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \ - Method) +#define GMOCK_METHOD7_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, 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::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 7), \ + this_method_does_not_take_7_arguments); \ + GMOCK_MOCKER_(7, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(7, constness, \ + Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ + __VA_ARGS__)>(gmock_a1), \ + ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \ + ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \ + ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \ + ::std::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7) constness { \ + GMOCK_MOCKER_(7, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(7, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(7, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ - 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_( \ - (::testing::tuple_size<tn ::testing::internal::Function< \ - __VA_ARGS__>::ArgumentTuple>::value == 8), \ - this_method_does_not_take_8_arguments); \ - GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(8, constness, Method) \ - .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ - gmock_a1), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ - gmock_a2), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ - gmock_a3), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ - gmock_a4), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \ - gmock_a5), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \ - gmock_a6), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \ - gmock_a7), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \ - gmock_a8)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ - GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ - GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \ - GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(8, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \ - gmock_a7, gmock_a8); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \ - Method) +#define GMOCK_METHOD8_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \ + __VA_ARGS__) gmock_a5, 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::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 8), \ + this_method_does_not_take_8_arguments); \ + GMOCK_MOCKER_(8, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(8, constness, \ + Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ + __VA_ARGS__)>(gmock_a1), \ + ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \ + ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \ + ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \ + ::std::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7), \ + ::std::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(gmock_a8)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ + GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8) constness { \ + GMOCK_MOCKER_(8, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(8, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(8, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ - 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_( \ - (::testing::tuple_size<tn ::testing::internal::Function< \ - __VA_ARGS__>::ArgumentTuple>::value == 9), \ - this_method_does_not_take_9_arguments); \ - GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(9, constness, Method) \ - .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ - gmock_a1), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ - gmock_a2), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ - gmock_a3), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ - gmock_a4), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \ - gmock_a5), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \ - gmock_a6), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \ - gmock_a7), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \ - gmock_a8), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>( \ - gmock_a9)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ - GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ - GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ - GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \ - GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(9, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \ - gmock_a7, gmock_a8, gmock_a9); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \ - Method) +#define GMOCK_METHOD9_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \ + __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ + 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::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 9), \ + this_method_does_not_take_9_arguments); \ + GMOCK_MOCKER_(9, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(9, constness, \ + Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ + __VA_ARGS__)>(gmock_a1), \ + ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \ + ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \ + ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \ + ::std::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7), \ + ::std::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(gmock_a8), \ + ::std::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(gmock_a9)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ + GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ + GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9) constness { \ + GMOCK_MOCKER_(9, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(9, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, \ + gmock_a9); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(9, constness, \ + Method) // INTERNAL IMPLEMENTATION - DON'T USE IN USER CODE!!! -#define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \ - GMOCK_RESULT_(tn, __VA_ARGS__) \ - ct Method(GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_ARG_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_ARG_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ - GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, \ - 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_( \ - (::testing::tuple_size<tn ::testing::internal::Function< \ - __VA_ARGS__>::ArgumentTuple>::value == 10), \ - this_method_does_not_take_10_arguments); \ - GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \ - return GMOCK_MOCKER_(10, constness, Method) \ - .Invoke(::testing::internal::forward<GMOCK_ARG_(tn, 1, __VA_ARGS__)>( \ - gmock_a1), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>( \ - gmock_a2), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>( \ - gmock_a3), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>( \ - gmock_a4), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>( \ - gmock_a5), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>( \ - gmock_a6), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>( \ - gmock_a7), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>( \ - gmock_a8), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>( \ - gmock_a9), \ - ::testing::internal::forward<GMOCK_ARG_(tn, 10, __VA_ARGS__)>( \ - gmock_a10)); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ - GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ - GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ - GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ - GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ - GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ - GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ - GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ - GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \ - GMOCK_MATCHER_(tn, 10, __VA_ARGS__) gmock_a10) constness { \ - GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \ - return GMOCK_MOCKER_(10, constness, Method) \ - .With(gmock_a1, gmock_a2, gmock_a3, gmock_a4, gmock_a5, gmock_a6, \ - gmock_a7, gmock_a8, gmock_a9, gmock_a10); \ - } \ - ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ - const ::testing::internal::WithoutMatchers&, \ - constness ::testing::internal::Function<__VA_ARGS__>*) const { \ - return ::testing::internal::AdjustConstness_##constness(this) \ - ->gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(), \ - ::testing::A<GMOCK_ARG_(tn, 10, __VA_ARGS__)>()); \ - } \ - mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \ - Method) +#define GMOCK_METHOD10_(tn, constness, ct, Method, ...) \ + GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ + GMOCK_ARG_(tn, 1, __VA_ARGS__) gmock_a1, GMOCK_ARG_(tn, 2, \ + __VA_ARGS__) gmock_a2, GMOCK_ARG_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_ARG_(tn, 4, __VA_ARGS__) gmock_a4, GMOCK_ARG_(tn, 5, \ + __VA_ARGS__) gmock_a5, GMOCK_ARG_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_ARG_(tn, 7, __VA_ARGS__) gmock_a7, 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::tuple_size< \ + tn ::testing::internal::Function<__VA_ARGS__>::ArgumentTuple>::value \ + == 10), \ + this_method_does_not_take_10_arguments); \ + GMOCK_MOCKER_(10, constness, Method).SetOwnerAndName(this, #Method); \ + return GMOCK_MOCKER_(10, constness, \ + Method).Invoke(::std::forward<GMOCK_ARG_(tn, 1, \ + __VA_ARGS__)>(gmock_a1), \ + ::std::forward<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(gmock_a2), \ + ::std::forward<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(gmock_a3), \ + ::std::forward<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(gmock_a4), \ + ::std::forward<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(gmock_a5), \ + ::std::forward<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(gmock_a6), \ + ::std::forward<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(gmock_a7), \ + ::std::forward<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(gmock_a8), \ + ::std::forward<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(gmock_a9), \ + ::std::forward<GMOCK_ARG_(tn, 10, __VA_ARGS__)>(gmock_a10)); \ + } \ + ::testing::MockSpec<__VA_ARGS__> \ + gmock_##Method(GMOCK_MATCHER_(tn, 1, __VA_ARGS__) gmock_a1, \ + GMOCK_MATCHER_(tn, 2, __VA_ARGS__) gmock_a2, \ + GMOCK_MATCHER_(tn, 3, __VA_ARGS__) gmock_a3, \ + GMOCK_MATCHER_(tn, 4, __VA_ARGS__) gmock_a4, \ + GMOCK_MATCHER_(tn, 5, __VA_ARGS__) gmock_a5, \ + GMOCK_MATCHER_(tn, 6, __VA_ARGS__) gmock_a6, \ + GMOCK_MATCHER_(tn, 7, __VA_ARGS__) gmock_a7, \ + GMOCK_MATCHER_(tn, 8, __VA_ARGS__) gmock_a8, \ + GMOCK_MATCHER_(tn, 9, __VA_ARGS__) gmock_a9, \ + GMOCK_MATCHER_(tn, 10, \ + __VA_ARGS__) gmock_a10) constness { \ + GMOCK_MOCKER_(10, constness, Method).RegisterOwner(this); \ + return GMOCK_MOCKER_(10, constness, Method).With(gmock_a1, gmock_a2, \ + gmock_a3, gmock_a4, gmock_a5, gmock_a6, gmock_a7, gmock_a8, gmock_a9, \ + gmock_a10); \ + } \ + ::testing::MockSpec<__VA_ARGS__> gmock_##Method( \ + const ::testing::internal::WithoutMatchers&, \ + constness ::testing::internal::Function<__VA_ARGS__>* ) const { \ + return ::testing::internal::AdjustConstness_##constness(this)-> \ + gmock_##Method(::testing::A<GMOCK_ARG_(tn, 1, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 2, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 3, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 4, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 5, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 6, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 7, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 8, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 9, __VA_ARGS__)>(), \ + ::testing::A<GMOCK_ARG_(tn, 10, __VA_ARGS__)>()); \ + } \ + mutable ::testing::FunctionMocker<__VA_ARGS__> GMOCK_MOCKER_(10, constness, \ + Method) #define MOCK_METHOD0(m, ...) GMOCK_METHOD0_(, , , m, __VA_ARGS__) #define MOCK_METHOD1(m, ...) GMOCK_METHOD1_(, , , m, __VA_ARGS__) @@ -1175,7 +1113,9 @@ class MockFunction<R(A0)> { #if GTEST_HAS_STD_FUNCTION_ ::std::function<R(A0)> AsStdFunction() { - return [this](A0 a0) -> R { return this->Call(::std::forward<A0>(a0)); }; + return [this](A0 a0) -> R { + return this->Call(::std::forward<A0>(a0)); + }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1213,7 +1153,7 @@ class MockFunction<R(A0, A1, A2)> { ::std::function<R(A0, A1, A2)> AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2) -> R { return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1), - ::std::forward<A2>(a2)); + ::std::forward<A2>(a2)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1233,7 +1173,7 @@ class MockFunction<R(A0, A1, A2, A3)> { ::std::function<R(A0, A1, A2, A3)> AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2, A3 a3) -> R { return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1), - ::std::forward<A2>(a2), ::std::forward<A3>(a3)); + ::std::forward<A2>(a2), ::std::forward<A3>(a3)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1254,8 +1194,8 @@ class MockFunction<R(A0, A1, A2, A3, A4)> { ::std::function<R(A0, A1, A2, A3, A4)> AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4) -> R { return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1), - ::std::forward<A2>(a2), ::std::forward<A3>(a3), - ::std::forward<A4>(a4)); + ::std::forward<A2>(a2), ::std::forward<A3>(a3), + ::std::forward<A4>(a4)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1276,8 +1216,8 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5)> { ::std::function<R(A0, A1, A2, A3, A4, A5)> AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5) -> R { return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1), - ::std::forward<A2>(a2), ::std::forward<A3>(a3), - ::std::forward<A4>(a4), ::std::forward<A5>(a5)); + ::std::forward<A2>(a2), ::std::forward<A3>(a3), + ::std::forward<A4>(a4), ::std::forward<A5>(a5)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1298,9 +1238,9 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6)> { ::std::function<R(A0, A1, A2, A3, A4, A5, A6)> AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6) -> R { return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1), - ::std::forward<A2>(a2), ::std::forward<A3>(a3), - ::std::forward<A4>(a4), ::std::forward<A5>(a5), - ::std::forward<A6>(a6)); + ::std::forward<A2>(a2), ::std::forward<A3>(a3), + ::std::forward<A4>(a4), ::std::forward<A5>(a5), + ::std::forward<A6>(a6)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1321,9 +1261,9 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7)> { ::std::function<R(A0, A1, A2, A3, A4, A5, A6, A7)> AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7) -> R { return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1), - ::std::forward<A2>(a2), ::std::forward<A3>(a3), - ::std::forward<A4>(a4), ::std::forward<A5>(a5), - ::std::forward<A6>(a6), ::std::forward<A7>(a7)); + ::std::forward<A2>(a2), ::std::forward<A3>(a3), + ::std::forward<A4>(a4), ::std::forward<A5>(a5), + ::std::forward<A6>(a6), ::std::forward<A7>(a7)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1343,12 +1283,12 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> { #if GTEST_HAS_STD_FUNCTION_ ::std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8)> AsStdFunction() { return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, - A8 a8) -> R { + A8 a8) -> R { return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1), - ::std::forward<A2>(a2), ::std::forward<A3>(a3), - ::std::forward<A4>(a4), ::std::forward<A5>(a5), - ::std::forward<A6>(a6), ::std::forward<A7>(a7), - ::std::forward<A8>(a8)); + ::std::forward<A2>(a2), ::std::forward<A3>(a3), + ::std::forward<A4>(a4), ::std::forward<A5>(a5), + ::std::forward<A6>(a6), ::std::forward<A7>(a7), + ::std::forward<A8>(a8)); }; } #endif // GTEST_HAS_STD_FUNCTION_ @@ -1368,13 +1308,13 @@ class MockFunction<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> { #if GTEST_HAS_STD_FUNCTION_ ::std::function<R(A0, A1, A2, A3, A4, A5, A6, A7, A8, A9)> AsStdFunction() { - return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, - A9 a9) -> R { + return [this](A0 a0, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, + A8 a8, A9 a9) -> R { return this->Call(::std::forward<A0>(a0), ::std::forward<A1>(a1), - ::std::forward<A2>(a2), ::std::forward<A3>(a3), - ::std::forward<A4>(a4), ::std::forward<A5>(a5), - ::std::forward<A6>(a6), ::std::forward<A7>(a7), - ::std::forward<A8>(a8), ::std::forward<A9>(a9)); + ::std::forward<A2>(a2), ::std::forward<A3>(a3), + ::std::forward<A4>(a4), ::std::forward<A5>(a5), + ::std::forward<A6>(a6), ::std::forward<A7>(a7), + ::std::forward<A8>(a8), ::std::forward<A9>(a9)); }; } #endif // GTEST_HAS_STD_FUNCTION_ diff --git a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump index 106abe84..183e652c 100644 --- a/googlemock/include/gmock/gmock-generated-function-mockers.h.pump +++ b/googlemock/include/gmock/gmock-generated-function-mockers.h.pump @@ -42,6 +42,8 @@ $var n = 10 $$ The maximum arity we support. #ifndef GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ #define GMOCK_INCLUDE_GMOCK_GMOCK_GENERATED_FUNCTION_MOCKERS_H_ +#include <utility> + #include "gmock/gmock-spec-builders.h" #include "gmock/internal/gmock-internal-utils.h" @@ -69,7 +71,7 @@ $for i [[ $range j 1..i $var typename_As = [[$for j [[, typename A$j]]]] $var As = [[$for j, [[A$j]]]] -$var as = [[$for j, [[internal::forward<A$j>(a$j)]]]] +$var as = [[$for j, [[std::forward<A$j>(a$j)]]]] $var Aas = [[$for j, [[A$j a$j]]]] $var ms = [[$for j, [[m$j]]]] $var matchers = [[$for j, [[const Matcher<A$j>& m$j]]]] @@ -81,7 +83,7 @@ class FunctionMocker<R($As)> : public typedef typename internal::Function<F>::ArgumentTuple ArgumentTuple; MockSpec<F> With($matchers) { - return MockSpec<F>(this, ::testing::make_tuple($ms)); + return MockSpec<F>(this, ::std::make_tuple($ms)); } R Invoke($Aas) { @@ -184,7 +186,7 @@ $for i [[ $range j 1..i $var arg_as = [[$for j, [[GMOCK_ARG_(tn, $j, __VA_ARGS__) gmock_a$j]]]] $var as = [[$for j, \ - [[::testing::internal::forward<GMOCK_ARG_(tn, $j, __VA_ARGS__)>(gmock_a$j)]]]] + [[::std::forward<GMOCK_ARG_(tn, $j, __VA_ARGS__)>(gmock_a$j)]]]] $var matcher_arg_as = [[$for j, \ [[GMOCK_MATCHER_(tn, $j, __VA_ARGS__) gmock_a$j]]]] $var matcher_as = [[$for j, [[gmock_a$j]]]] @@ -194,7 +196,7 @@ $var anything_matchers = [[$for j, \ #define GMOCK_METHOD$i[[]]_(tn, constness, ct, Method, ...) \ GMOCK_RESULT_(tn, __VA_ARGS__) ct Method( \ $arg_as) constness { \ - GTEST_COMPILE_ASSERT_((::testing::tuple_size< \ + GTEST_COMPILE_ASSERT_((::std::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/googlemock/include/gmock/gmock-generated-matchers.h b/googlemock/include/gmock/gmock-generated-matchers.h index 16093bf8..1161e870 100644 --- a/googlemock/include/gmock/gmock-generated-matchers.h +++ b/googlemock/include/gmock/gmock-generated-matchers.h @@ -43,6 +43,7 @@ #include <iterator> #include <sstream> #include <string> +#include <utility> #include <vector> #include "gmock/gmock-matchers.h" @@ -51,7 +52,7 @@ namespace internal { // The type of the i-th (0-based) field of Tuple. #define GMOCK_FIELD_TYPE_(Tuple, i) \ - typename ::testing::tuple_element<i, Tuple>::type + typename ::std::tuple_element<i, Tuple>::type // TupleFields<Tuple, k0, ..., kn> is for selecting fields from a // tuple of type Tuple. It has two members: @@ -59,10 +60,11 @@ namespace internal { // type: a tuple type whose i-th field is the ki-th field of Tuple. // GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple. // -// For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have: +// For example, in class TupleFields<std::tuple<bool, char, int>, 2, 0>, +// we have: // -// type is tuple<int, bool>, and -// GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true). +// type is std::tuple<int, bool>, and +// GetSelectedFields(std::make_tuple(true, 'a', 42)) is (42, true). template <class Tuple, int k0 = -1, int k1 = -1, int k2 = -1, int k3 = -1, int k4 = -1, int k5 = -1, int k6 = -1, int k7 = -1, int k8 = -1, @@ -74,15 +76,15 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8, int k9> class TupleFields { public: - typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), - GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), - GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4), - GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6), - GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8), - GMOCK_FIELD_TYPE_(Tuple, k9)> type; + typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple, + k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3), + GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5), + GMOCK_FIELD_TYPE_(Tuple, k6), GMOCK_FIELD_TYPE_(Tuple, k7), + GMOCK_FIELD_TYPE_(Tuple, k8), GMOCK_FIELD_TYPE_(Tuple, k9)> type; static type GetSelectedFields(const Tuple& t) { - return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t), - get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t), get<k9>(t)); + return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t), + std::get<k3>(t), std::get<k4>(t), std::get<k5>(t), std::get<k6>(t), + std::get<k7>(t), std::get<k8>(t), std::get<k9>(t)); } }; @@ -91,7 +93,7 @@ class TupleFields { template <class Tuple> class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> { public: - typedef ::testing::tuple<> type; + typedef ::std::tuple<> type; static type GetSelectedFields(const Tuple& /* t */) { return type(); } @@ -100,77 +102,77 @@ class TupleFields<Tuple, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1> { template <class Tuple, int k0> class TupleFields<Tuple, k0, -1, -1, -1, -1, -1, -1, -1, -1, -1> { public: - typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type; + typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0)> type; static type GetSelectedFields(const Tuple& t) { - return type(get<k0>(t)); + return type(std::get<k0>(t)); } }; template <class Tuple, int k0, int k1> class TupleFields<Tuple, k0, k1, -1, -1, -1, -1, -1, -1, -1, -1> { public: - typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), - GMOCK_FIELD_TYPE_(Tuple, k1)> type; + typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple, + k1)> type; static type GetSelectedFields(const Tuple& t) { - return type(get<k0>(t), get<k1>(t)); + return type(std::get<k0>(t), std::get<k1>(t)); } }; template <class Tuple, int k0, int k1, int k2> class TupleFields<Tuple, k0, k1, k2, -1, -1, -1, -1, -1, -1, -1> { public: - typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), - GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type; + typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple, + k1), GMOCK_FIELD_TYPE_(Tuple, k2)> type; static type GetSelectedFields(const Tuple& t) { - return type(get<k0>(t), get<k1>(t), get<k2>(t)); + return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t)); } }; template <class Tuple, int k0, int k1, int k2, int k3> class TupleFields<Tuple, k0, k1, k2, k3, -1, -1, -1, -1, -1, -1> { public: - typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), - GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), - GMOCK_FIELD_TYPE_(Tuple, k3)> type; + typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple, + k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3)> type; static type GetSelectedFields(const Tuple& t) { - return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t)); + return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t), + std::get<k3>(t)); } }; template <class Tuple, int k0, int k1, int k2, int k3, int k4> class TupleFields<Tuple, k0, k1, k2, k3, k4, -1, -1, -1, -1, -1> { public: - typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), - GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), - GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4)> type; + typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple, + k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3), + GMOCK_FIELD_TYPE_(Tuple, k4)> type; static type GetSelectedFields(const Tuple& t) { - return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t)); + return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t), + std::get<k3>(t), std::get<k4>(t)); } }; template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5> class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, -1, -1, -1, -1> { public: - typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), - GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), - GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4), - GMOCK_FIELD_TYPE_(Tuple, k5)> type; + typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple, + k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3), + GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5)> type; static type GetSelectedFields(const Tuple& t) { - return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t), - get<k5>(t)); + return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t), + std::get<k3>(t), std::get<k4>(t), std::get<k5>(t)); } }; template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6> class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, -1, -1, -1> { public: - typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), - GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), - GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4), - GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6)> type; + typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple, + k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3), + GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5), + GMOCK_FIELD_TYPE_(Tuple, k6)> type; static type GetSelectedFields(const Tuple& t) { - return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t), - get<k5>(t), get<k6>(t)); + return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t), + std::get<k3>(t), std::get<k4>(t), std::get<k5>(t), std::get<k6>(t)); } }; @@ -178,14 +180,14 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6, int k7> class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, -1, -1> { public: - typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), - GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), - GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4), - GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6), - GMOCK_FIELD_TYPE_(Tuple, k7)> type; + typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple, + k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3), + GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5), + GMOCK_FIELD_TYPE_(Tuple, k6), GMOCK_FIELD_TYPE_(Tuple, k7)> type; static type GetSelectedFields(const Tuple& t) { - return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t), - get<k5>(t), get<k6>(t), get<k7>(t)); + return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t), + std::get<k3>(t), std::get<k4>(t), std::get<k5>(t), std::get<k6>(t), + std::get<k7>(t)); } }; @@ -193,14 +195,15 @@ template <class Tuple, int k0, int k1, int k2, int k3, int k4, int k5, int k6, int k7, int k8> class TupleFields<Tuple, k0, k1, k2, k3, k4, k5, k6, k7, k8, -1> { public: - typedef ::testing::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), - GMOCK_FIELD_TYPE_(Tuple, k1), GMOCK_FIELD_TYPE_(Tuple, k2), - GMOCK_FIELD_TYPE_(Tuple, k3), GMOCK_FIELD_TYPE_(Tuple, k4), - GMOCK_FIELD_TYPE_(Tuple, k5), GMOCK_FIELD_TYPE_(Tuple, k6), - GMOCK_FIELD_TYPE_(Tuple, k7), GMOCK_FIELD_TYPE_(Tuple, k8)> type; + typedef ::std::tuple<GMOCK_FIELD_TYPE_(Tuple, k0), GMOCK_FIELD_TYPE_(Tuple, + k1), GMOCK_FIELD_TYPE_(Tuple, k2), GMOCK_FIELD_TYPE_(Tuple, k3), + GMOCK_FIELD_TYPE_(Tuple, k4), GMOCK_FIELD_TYPE_(Tuple, k5), + GMOCK_FIELD_TYPE_(Tuple, k6), GMOCK_FIELD_TYPE_(Tuple, k7), + GMOCK_FIELD_TYPE_(Tuple, k8)> type; static type GetSelectedFields(const Tuple& t) { - return type(get<k0>(t), get<k1>(t), get<k2>(t), get<k3>(t), get<k4>(t), - get<k5>(t), get<k6>(t), get<k7>(t), get<k8>(t)); + return type(std::get<k0>(t), std::get<k1>(t), std::get<k2>(t), + std::get<k3>(t), std::get<k4>(t), std::get<k5>(t), std::get<k6>(t), + std::get<k7>(t), std::get<k8>(t)); } }; @@ -297,182 +300,6 @@ class ArgsMatcher { GTEST_DISALLOW_ASSIGN_(ArgsMatcher); }; -// A set of metafunctions for computing the result type of AllOf. -// AllOf(m1, ..., mN) returns -// AllOfResultN<decltype(m1), ..., decltype(mN)>::type. - -// Although AllOf isn't defined for one argument, AllOfResult1 is defined -// to simplify the implementation. -template <typename M1> -struct AllOfResult1 { - typedef M1 type; -}; - -template <typename M1, typename M2> -struct AllOfResult2 { - typedef BothOfMatcher< - typename AllOfResult1<M1>::type, - typename AllOfResult1<M2>::type - > type; -}; - -template <typename M1, typename M2, typename M3> -struct AllOfResult3 { - typedef BothOfMatcher< - typename AllOfResult1<M1>::type, - typename AllOfResult2<M2, M3>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4> -struct AllOfResult4 { - typedef BothOfMatcher< - typename AllOfResult2<M1, M2>::type, - typename AllOfResult2<M3, M4>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4, typename M5> -struct AllOfResult5 { - typedef BothOfMatcher< - typename AllOfResult2<M1, M2>::type, - typename AllOfResult3<M3, M4, M5>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6> -struct AllOfResult6 { - typedef BothOfMatcher< - typename AllOfResult3<M1, M2, M3>::type, - typename AllOfResult3<M4, M5, M6>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7> -struct AllOfResult7 { - typedef BothOfMatcher< - typename AllOfResult3<M1, M2, M3>::type, - typename AllOfResult4<M4, M5, M6, M7>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7, typename M8> -struct AllOfResult8 { - typedef BothOfMatcher< - typename AllOfResult4<M1, M2, M3, M4>::type, - typename AllOfResult4<M5, M6, M7, M8>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7, typename M8, typename M9> -struct AllOfResult9 { - typedef BothOfMatcher< - typename AllOfResult4<M1, M2, M3, M4>::type, - typename AllOfResult5<M5, M6, M7, M8, M9>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7, typename M8, typename M9, typename M10> -struct AllOfResult10 { - typedef BothOfMatcher< - typename AllOfResult5<M1, M2, M3, M4, M5>::type, - typename AllOfResult5<M6, M7, M8, M9, M10>::type - > type; -}; - -// A set of metafunctions for computing the result type of AnyOf. -// AnyOf(m1, ..., mN) returns -// AnyOfResultN<decltype(m1), ..., decltype(mN)>::type. - -// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined -// to simplify the implementation. -template <typename M1> -struct AnyOfResult1 { - typedef M1 type; -}; - -template <typename M1, typename M2> -struct AnyOfResult2 { - typedef EitherOfMatcher< - typename AnyOfResult1<M1>::type, - typename AnyOfResult1<M2>::type - > type; -}; - -template <typename M1, typename M2, typename M3> -struct AnyOfResult3 { - typedef EitherOfMatcher< - typename AnyOfResult1<M1>::type, - typename AnyOfResult2<M2, M3>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4> -struct AnyOfResult4 { - typedef EitherOfMatcher< - typename AnyOfResult2<M1, M2>::type, - typename AnyOfResult2<M3, M4>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4, typename M5> -struct AnyOfResult5 { - typedef EitherOfMatcher< - typename AnyOfResult2<M1, M2>::type, - typename AnyOfResult3<M3, M4, M5>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6> -struct AnyOfResult6 { - typedef EitherOfMatcher< - typename AnyOfResult3<M1, M2, M3>::type, - typename AnyOfResult3<M4, M5, M6>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7> -struct AnyOfResult7 { - typedef EitherOfMatcher< - typename AnyOfResult3<M1, M2, M3>::type, - typename AnyOfResult4<M4, M5, M6, M7>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7, typename M8> -struct AnyOfResult8 { - typedef EitherOfMatcher< - typename AnyOfResult4<M1, M2, M3, M4>::type, - typename AnyOfResult4<M5, M6, M7, M8>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7, typename M8, typename M9> -struct AnyOfResult9 { - typedef EitherOfMatcher< - typename AnyOfResult4<M1, M2, M3, M4>::type, - typename AnyOfResult5<M5, M6, M7, M8, M9>::type - > type; -}; - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7, typename M8, typename M9, typename M10> -struct AnyOfResult10 { - typedef EitherOfMatcher< - typename AnyOfResult5<M1, M2, M3, M4, M5>::type, - typename AnyOfResult5<M6, M7, M8, M9, M10>::type - > type; -}; - } // namespace internal // Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected @@ -553,171 +380,6 @@ Args(const InnerMatcher& matcher) { k9, k10>(matcher); } -// AllOf(m1, m2, ..., mk) matches any value that matches all of the given -// sub-matchers. AllOf is called fully qualified to prevent ADL from firing. - -template <typename M1, typename M2> -inline typename internal::AllOfResult2<M1, M2>::type -AllOf(M1 m1, M2 m2) { - return typename internal::AllOfResult2<M1, M2>::type( - m1, - m2); -} - -template <typename M1, typename M2, typename M3> -inline typename internal::AllOfResult3<M1, M2, M3>::type -AllOf(M1 m1, M2 m2, M3 m3) { - return typename internal::AllOfResult3<M1, M2, M3>::type( - m1, - ::testing::AllOf(m2, m3)); -} - -template <typename M1, typename M2, typename M3, typename M4> -inline typename internal::AllOfResult4<M1, M2, M3, M4>::type -AllOf(M1 m1, M2 m2, M3 m3, M4 m4) { - return typename internal::AllOfResult4<M1, M2, M3, M4>::type( - ::testing::AllOf(m1, m2), - ::testing::AllOf(m3, m4)); -} - -template <typename M1, typename M2, typename M3, typename M4, typename M5> -inline typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type -AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) { - return typename internal::AllOfResult5<M1, M2, M3, M4, M5>::type( - ::testing::AllOf(m1, m2), - ::testing::AllOf(m3, m4, m5)); -} - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6> -inline typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type -AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) { - return typename internal::AllOfResult6<M1, M2, M3, M4, M5, M6>::type( - ::testing::AllOf(m1, m2, m3), - ::testing::AllOf(m4, m5, m6)); -} - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7> -inline typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type -AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) { - return typename internal::AllOfResult7<M1, M2, M3, M4, M5, M6, M7>::type( - ::testing::AllOf(m1, m2, m3), - ::testing::AllOf(m4, m5, m6, m7)); -} - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7, typename M8> -inline typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type -AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) { - return typename internal::AllOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type( - ::testing::AllOf(m1, m2, m3, m4), - ::testing::AllOf(m5, m6, m7, m8)); -} - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7, typename M8, typename M9> -inline typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type -AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) { - return typename internal::AllOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, - M9>::type( - ::testing::AllOf(m1, m2, m3, m4), - ::testing::AllOf(m5, m6, m7, m8, m9)); -} - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7, typename M8, typename M9, typename M10> -inline typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9, - M10>::type -AllOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { - return typename internal::AllOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9, - M10>::type( - ::testing::AllOf(m1, m2, m3, m4, m5), - ::testing::AllOf(m6, m7, m8, m9, m10)); -} - -// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given -// sub-matchers. AnyOf is called fully qualified to prevent ADL from firing. - -template <typename M1, typename M2> -inline typename internal::AnyOfResult2<M1, M2>::type -AnyOf(M1 m1, M2 m2) { - return typename internal::AnyOfResult2<M1, M2>::type( - m1, - m2); -} - -template <typename M1, typename M2, typename M3> -inline typename internal::AnyOfResult3<M1, M2, M3>::type -AnyOf(M1 m1, M2 m2, M3 m3) { - return typename internal::AnyOfResult3<M1, M2, M3>::type( - m1, - ::testing::AnyOf(m2, m3)); -} - -template <typename M1, typename M2, typename M3, typename M4> -inline typename internal::AnyOfResult4<M1, M2, M3, M4>::type -AnyOf(M1 m1, M2 m2, M3 m3, M4 m4) { - return typename internal::AnyOfResult4<M1, M2, M3, M4>::type( - ::testing::AnyOf(m1, m2), - ::testing::AnyOf(m3, m4)); -} - -template <typename M1, typename M2, typename M3, typename M4, typename M5> -inline typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type -AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5) { - return typename internal::AnyOfResult5<M1, M2, M3, M4, M5>::type( - ::testing::AnyOf(m1, m2), - ::testing::AnyOf(m3, m4, m5)); -} - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6> -inline typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type -AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6) { - return typename internal::AnyOfResult6<M1, M2, M3, M4, M5, M6>::type( - ::testing::AnyOf(m1, m2, m3), - ::testing::AnyOf(m4, m5, m6)); -} - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7> -inline typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type -AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7) { - return typename internal::AnyOfResult7<M1, M2, M3, M4, M5, M6, M7>::type( - ::testing::AnyOf(m1, m2, m3), - ::testing::AnyOf(m4, m5, m6, m7)); -} - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7, typename M8> -inline typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type -AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8) { - return typename internal::AnyOfResult8<M1, M2, M3, M4, M5, M6, M7, M8>::type( - ::testing::AnyOf(m1, m2, m3, m4), - ::testing::AnyOf(m5, m6, m7, m8)); -} - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7, typename M8, typename M9> -inline typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, M9>::type -AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9) { - return typename internal::AnyOfResult9<M1, M2, M3, M4, M5, M6, M7, M8, - M9>::type( - ::testing::AnyOf(m1, m2, m3, m4), - ::testing::AnyOf(m5, m6, m7, m8, m9)); -} - -template <typename M1, typename M2, typename M3, typename M4, typename M5, - typename M6, typename M7, typename M8, typename M9, typename M10> -inline typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9, - M10>::type -AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { - return typename internal::AnyOfResult10<M1, M2, M3, M4, M5, M6, M7, M8, M9, - M10>::type( - ::testing::AnyOf(m1, m2, m3, m4, m5), - ::testing::AnyOf(m6, m7, m8, m9, m10)); -} } // namespace testing @@ -965,7 +627,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(\ - ::testing::tuple<>()));\ + ::std::tuple<>()));\ }\ };\ template <typename arg_type>\ @@ -995,7 +657,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { GTEST_REFERENCE_TO_CONST_(arg_type)> {\ public:\ explicit gmock_Impl(p0##_type gmock_p0)\ - : p0(::testing::internal::move(gmock_p0)) {}\ + : p0(::std::move(gmock_p0)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1015,7 +677,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(\ - ::testing::tuple<p0##_type>(p0)));\ + ::std::tuple<p0##_type>(p0)));\ }\ };\ template <typename arg_type>\ @@ -1023,8 +685,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { return ::testing::Matcher<arg_type>(\ new gmock_Impl<arg_type>(p0));\ }\ - explicit name##MatcherP(p0##_type gmock_p0) : \ - p0(::testing::internal::move(gmock_p0)) {\ + explicit name##MatcherP(p0##_type gmock_p0) : p0(::std::move(gmock_p0)) {\ }\ p0##_type const p0;\ private:\ @@ -1049,8 +710,7 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { GTEST_REFERENCE_TO_CONST_(arg_type)> {\ public:\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1071,7 +731,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(\ - ::testing::tuple<p0##_type, p1##_type>(p0, p1)));\ + ::std::tuple<p0##_type, p1##_type>(p0, p1)));\ }\ };\ template <typename arg_type>\ @@ -1080,8 +740,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { new gmock_Impl<arg_type>(p0, p1));\ }\ name##MatcherP2(p0##_type gmock_p0, \ - p1##_type gmock_p1) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)) {\ + p1##_type gmock_p1) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -1109,9 +769,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { GTEST_REFERENCE_TO_CONST_(arg_type)> {\ public:\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1133,8 +792,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(\ - ::testing::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, \ - p2)));\ + ::std::tuple<p0##_type, p1##_type, p2##_type>(p0, p1, p2)));\ }\ };\ template <typename arg_type>\ @@ -1143,9 +801,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { new gmock_Impl<arg_type>(p0, p1, p2));\ }\ name##MatcherP3(p0##_type gmock_p0, p1##_type gmock_p1, \ - p2##_type gmock_p2) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)) {\ + p2##_type gmock_p2) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -1176,10 +833,8 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { public:\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1202,8 +857,8 @@ 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(\ - ::testing::tuple<p0##_type, p1##_type, p2##_type, \ - p3##_type>(p0, p1, p2, p3)));\ + ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type>(p0, \ + p1, p2, p3)));\ }\ };\ template <typename arg_type>\ @@ -1212,11 +867,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { new gmock_Impl<arg_type>(p0, p1, p2, p3));\ }\ name##MatcherP4(p0##_type gmock_p0, p1##_type gmock_p1, \ - p2##_type gmock_p2, \ - p3##_type gmock_p3) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)) {\ + p2##_type gmock_p2, p3##_type gmock_p3) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -1252,11 +905,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { public:\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1280,7 +931,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(\ - ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ + ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ p4##_type>(p0, p1, p2, p3, p4)));\ }\ };\ @@ -1291,11 +942,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { }\ name##MatcherP5(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, \ - p4##_type gmock_p4) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)) {\ + p4##_type gmock_p4) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -1332,12 +981,9 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { public:\ gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1362,7 +1008,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(\ - ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ + ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ p4##_type, p5##_type>(p0, p1, p2, p3, p4, p5)));\ }\ };\ @@ -1373,12 +1019,10 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { }\ name##MatcherP6(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ - p5##_type gmock_p5) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)) {\ + p5##_type gmock_p5) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -1418,13 +1062,10 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1450,7 +1091,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(\ - ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ + ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ p4##_type, p5##_type, p6##_type>(p0, p1, p2, p3, p4, p5, \ p6)));\ }\ @@ -1462,14 +1103,10 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { }\ name##MatcherP7(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ - p5##_type gmock_p5, \ - p6##_type gmock_p6) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)) {\ + p5##_type gmock_p5, p6##_type gmock_p6) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -1513,14 +1150,10 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1547,7 +1180,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(\ - ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ + ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ p4##_type, p5##_type, p6##_type, p7##_type>(p0, p1, p2, \ p3, p4, p5, p6, p7)));\ }\ @@ -1560,14 +1193,11 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { name##MatcherP8(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, p6##_type gmock_p6, \ - p7##_type gmock_p7) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)) {\ + p7##_type gmock_p7) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ + p7(::std::move(gmock_p7)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -1614,15 +1244,11 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { gmock_Impl(p0##_type gmock_p0, p1##_type gmock_p1, p2##_type gmock_p2, \ p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)), \ - p8(::testing::internal::move(gmock_p8)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \ + p8(::std::move(gmock_p8)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1650,7 +1276,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(\ - ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ + ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ p4##_type, p5##_type, p6##_type, p7##_type, \ p8##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8)));\ }\ @@ -1663,15 +1289,11 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { name##MatcherP9(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ - p8##_type gmock_p8) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)), \ - p8(::testing::internal::move(gmock_p8)) {\ + p8##_type gmock_p8) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ + p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ @@ -1722,16 +1344,11 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { p3##_type gmock_p3, p4##_type gmock_p4, p5##_type gmock_p5, \ p6##_type gmock_p6, p7##_type gmock_p7, p8##_type gmock_p8, \ p9##_type gmock_p9)\ - : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)), \ - p8(::testing::internal::move(gmock_p8)), \ - p9(::testing::internal::move(gmock_p9)) {}\ + : p0(::std::move(gmock_p0)), p1(::std::move(gmock_p1)), \ + p2(::std::move(gmock_p2)), p3(::std::move(gmock_p3)), \ + p4(::std::move(gmock_p4)), p5(::std::move(gmock_p5)), \ + p6(::std::move(gmock_p6)), p7(::std::move(gmock_p7)), \ + p8(::std::move(gmock_p8)), p9(::std::move(gmock_p9)) {}\ virtual bool MatchAndExplain(\ GTEST_REFERENCE_TO_CONST_(arg_type) arg,\ ::testing::MatchResultListener* result_listener) const;\ @@ -1760,7 +1377,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(\ - ::testing::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ + ::std::tuple<p0##_type, p1##_type, p2##_type, p3##_type, \ p4##_type, p5##_type, p6##_type, p7##_type, p8##_type, \ p9##_type>(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9)));\ }\ @@ -1773,17 +1390,12 @@ AnyOf(M1 m1, M2 m2, M3 m3, M4 m4, M5 m5, M6 m6, M7 m7, M8 m8, M9 m9, M10 m10) { name##MatcherP10(p0##_type gmock_p0, p1##_type gmock_p1, \ p2##_type gmock_p2, p3##_type gmock_p3, p4##_type gmock_p4, \ p5##_type gmock_p5, p6##_type gmock_p6, p7##_type gmock_p7, \ - p8##_type gmock_p8, \ - p9##_type gmock_p9) : p0(::testing::internal::move(gmock_p0)), \ - p1(::testing::internal::move(gmock_p1)), \ - p2(::testing::internal::move(gmock_p2)), \ - p3(::testing::internal::move(gmock_p3)), \ - p4(::testing::internal::move(gmock_p4)), \ - p5(::testing::internal::move(gmock_p5)), \ - p6(::testing::internal::move(gmock_p6)), \ - p7(::testing::internal::move(gmock_p7)), \ - p8(::testing::internal::move(gmock_p8)), \ - p9(::testing::internal::move(gmock_p9)) {\ + p8##_type gmock_p8, p9##_type gmock_p9) : p0(::std::move(gmock_p0)), \ + p1(::std::move(gmock_p1)), p2(::std::move(gmock_p2)), \ + p3(::std::move(gmock_p3)), p4(::std::move(gmock_p4)), \ + p5(::std::move(gmock_p5)), p6(::std::move(gmock_p6)), \ + p7(::std::move(gmock_p7)), p8(::std::move(gmock_p8)), \ + p9(::std::move(gmock_p9)) {\ }\ p0##_type const p0;\ p1##_type const p1;\ diff --git a/googlemock/include/gmock/gmock-generated-matchers.h.pump b/googlemock/include/gmock/gmock-generated-matchers.h.pump index e1f2f838..dcb42435 100644 --- a/googlemock/include/gmock/gmock-generated-matchers.h.pump +++ b/googlemock/include/gmock/gmock-generated-matchers.h.pump @@ -45,6 +45,7 @@ $$ }} This line fixes auto-indentation of the following code in Emacs. #include <iterator> #include <sstream> #include <string> +#include <utility> #include <vector> #include "gmock/gmock-matchers.h" @@ -55,7 +56,7 @@ $range i 0..n-1 // The type of the i-th (0-based) field of Tuple. #define GMOCK_FIELD_TYPE_(Tuple, i) \ - typename ::testing::tuple_element<i, Tuple>::type + typename ::std::tuple_element<i, Tuple>::type // TupleFields<Tuple, k0, ..., kn> is for selecting fields from a // tuple of type Tuple. It has two members: @@ -63,10 +64,11 @@ $range i 0..n-1 // type: a tuple type whose i-th field is the ki-th field of Tuple. // GetSelectedFields(t): returns fields k0, ..., and kn of t as a tuple. // -// For example, in class TupleFields<tuple<bool, char, int>, 2, 0>, we have: +// For example, in class TupleFields<std::tuple<bool, char, int>, 2, 0>, +// we have: // -// type is tuple<int, bool>, and -// GetSelectedFields(make_tuple(true, 'a', 42)) is (42, true). +// type is std::tuple<int, bool>, and +// GetSelectedFields(std::make_tuple(true, 'a', 42)) is (42, true). template <class Tuple$for i [[, int k$i = -1]]> class TupleFields; @@ -75,9 +77,9 @@ class TupleFields; template <class Tuple$for i [[, int k$i]]> class TupleFields { public: - typedef ::testing::tuple<$for i, [[GMOCK_FIELD_TYPE_(Tuple, k$i)]]> type; + typedef ::std::tuple<$for i, [[GMOCK_FIELD_TYPE_(Tuple, k$i)]]> type; static type GetSelectedFields(const Tuple& t) { - return type($for i, [[get<k$i>(t)]]); + return type($for i, [[std::get<k$i>(t)]]); } }; @@ -91,9 +93,9 @@ $range k 0..n-1 template <class Tuple$for j [[, int k$j]]> class TupleFields<Tuple, $for k, [[$if k < i [[k$k]] $else [[-1]]]]> { public: - typedef ::testing::tuple<$for j, [[GMOCK_FIELD_TYPE_(Tuple, k$j)]]> type; + typedef ::std::tuple<$for j, [[GMOCK_FIELD_TYPE_(Tuple, k$j)]]> type; static type GetSelectedFields(const Tuple& $if i==0 [[/* t */]] $else [[t]]) { - return type($for j, [[get<k$j>(t)]]); + return type($for j, [[std::get<k$j>(t)]]); } }; @@ -187,66 +189,6 @@ class ArgsMatcher { GTEST_DISALLOW_ASSIGN_(ArgsMatcher); }; -// A set of metafunctions for computing the result type of AllOf. -// AllOf(m1, ..., mN) returns -// AllOfResultN<decltype(m1), ..., decltype(mN)>::type. - -// Although AllOf isn't defined for one argument, AllOfResult1 is defined -// to simplify the implementation. -template <typename M1> -struct AllOfResult1 { - typedef M1 type; -}; - -$range i 1..n - -$range i 2..n -$for i [[ -$range j 2..i -$var m = i/2 -$range k 1..m -$range t m+1..i - -template <typename M1$for j [[, typename M$j]]> -struct AllOfResult$i { - typedef BothOfMatcher< - typename AllOfResult$m<$for k, [[M$k]]>::type, - typename AllOfResult$(i-m)<$for t, [[M$t]]>::type - > type; -}; - -]] - -// A set of metafunctions for computing the result type of AnyOf. -// AnyOf(m1, ..., mN) returns -// AnyOfResultN<decltype(m1), ..., decltype(mN)>::type. - -// Although AnyOf isn't defined for one argument, AnyOfResult1 is defined -// to simplify the implementation. -template <typename M1> -struct AnyOfResult1 { - typedef M1 type; -}; - -$range i 1..n - -$range i 2..n -$for i [[ -$range j 2..i -$var m = i/2 -$range k 1..m -$range t m+1..i - -template <typename M1$for j [[, typename M$j]]> -struct AnyOfResult$i { - typedef EitherOfMatcher< - typename AnyOfResult$m<$for k, [[M$k]]>::type, - typename AnyOfResult$(i-m)<$for t, [[M$t]]>::type - > type; -}; - -]] - } // namespace internal // Args<N1, N2, ..., Nk>(a_matcher) matches a tuple if the selected @@ -265,46 +207,6 @@ Args(const InnerMatcher& matcher) { ]] -// AllOf(m1, m2, ..., mk) matches any value that matches all of the given -// sub-matchers. AllOf is called fully qualified to prevent ADL from firing. - -$range i 2..n -$for i [[ -$range j 1..i -$var m = i/2 -$range k 1..m -$range t m+1..i - -template <$for j, [[typename M$j]]> -inline typename internal::AllOfResult$i<$for j, [[M$j]]>::type -AllOf($for j, [[M$j m$j]]) { - return typename internal::AllOfResult$i<$for j, [[M$j]]>::type( - $if m == 1 [[m1]] $else [[::testing::AllOf($for k, [[m$k]])]], - $if m+1 == i [[m$i]] $else [[::testing::AllOf($for t, [[m$t]])]]); -} - -]] - -// AnyOf(m1, m2, ..., mk) matches any value that matches any of the given -// sub-matchers. AnyOf is called fully qualified to prevent ADL from firing. - -$range i 2..n -$for i [[ -$range j 1..i -$var m = i/2 -$range k 1..m -$range t m+1..i - -template <$for j, [[typename M$j]]> -inline typename internal::AnyOfResult$i<$for j, [[M$j]]>::type -AnyOf($for j, [[M$j m$j]]) { - return typename internal::AnyOfResult$i<$for j, [[M$j]]>::type( - $if m == 1 [[m1]] $else [[::testing::AnyOf($for k, [[m$k]])]], - $if m+1 == i [[m$i]] $else [[::testing::AnyOf($for t, [[m$t]])]]); -} - -]] - } // namespace testing $$ } // This Pump meta comment fixes auto-indentation in Emacs. It will not $$ // show up in the generated code. @@ -541,8 +443,8 @@ $var template = [[$if i==0 [[]] $else [[ ]]]] $var ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] $var impl_ctor_param_list = [[$for j, [[p$j##_type gmock_p$j]]]] -$var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::testing::internal::move(gmock_p$j))]]]]]] -$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::testing::internal::move(gmock_p$j))]]]]]] +$var impl_inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::std::move(gmock_p$j))]]]]]] +$var inits = [[$if i==0 [[]] $else [[ : $for j, [[p$j(::std::move(gmock_p$j))]]]]]] $var params = [[$for j, [[p$j]]]] $var param_types = [[$if i==0 [[]] $else [[<$for j, [[p$j##_type]]>]]]] $var param_types_and_names = [[$for j, [[p$j##_type p$j]]]] @@ -584,7 +486,7 @@ $var param_field_decls2 = [[$for j return ::testing::internal::FormatMatcherDescription(\ negation, #name, \ ::testing::internal::UniversalTersePrintTupleFieldsToStrings(\ - ::testing::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\ + ::std::tuple<$for j, [[p$j##_type]]>($for j, [[p$j]])));\ }\ };\ template <typename arg_type>\ diff --git a/googlemock/include/gmock/gmock-matchers.h b/googlemock/include/gmock/gmock-matchers.h index 0f7745ea..6e8bc036 100644 --- a/googlemock/include/gmock/gmock-matchers.h +++ b/googlemock/include/gmock/gmock-matchers.h @@ -905,8 +905,8 @@ class TuplePrefix { template <typename MatcherTuple, typename ValueTuple> static bool Matches(const MatcherTuple& matcher_tuple, const ValueTuple& value_tuple) { - return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple) - && get<N - 1>(matcher_tuple).Matches(get<N - 1>(value_tuple)); + return TuplePrefix<N - 1>::Matches(matcher_tuple, value_tuple) && + std::get<N - 1>(matcher_tuple).Matches(std::get<N - 1>(value_tuple)); } // TuplePrefix<N>::ExplainMatchFailuresTo(matchers, values, os) @@ -922,16 +922,16 @@ class TuplePrefix { // Then describes the failure (if any) in the (N - 1)-th (0-based) // field. - typename tuple_element<N - 1, MatcherTuple>::type matcher = - get<N - 1>(matchers); - typedef typename tuple_element<N - 1, ValueTuple>::type Value; - GTEST_REFERENCE_TO_CONST_(Value) value = get<N - 1>(values); + typename std::tuple_element<N - 1, MatcherTuple>::type matcher = + std::get<N - 1>(matchers); + typedef typename std::tuple_element<N - 1, ValueTuple>::type Value; + GTEST_REFERENCE_TO_CONST_(Value) value = std::get<N - 1>(values); StringMatchResultListener listener; if (!matcher.MatchAndExplain(value, &listener)) { // FIXME: include in the message the name of the parameter // as used in MOCK_METHOD*() when possible. *os << " Expected arg #" << N - 1 << ": "; - get<N - 1>(matchers).DescribeTo(os); + std::get<N - 1>(matchers).DescribeTo(os); *os << "\n Actual: "; // We remove the reference in type Value to prevent the // universal printer from printing the address of value, which @@ -971,11 +971,11 @@ bool TupleMatches(const MatcherTuple& matcher_tuple, const ValueTuple& value_tuple) { // Makes sure that matcher_tuple and value_tuple have the same // number of fields. - GTEST_COMPILE_ASSERT_(tuple_size<MatcherTuple>::value == - tuple_size<ValueTuple>::value, + GTEST_COMPILE_ASSERT_(std::tuple_size<MatcherTuple>::value == + std::tuple_size<ValueTuple>::value, matcher_and_value_have_different_numbers_of_fields); - return TuplePrefix<tuple_size<ValueTuple>::value>:: - Matches(matcher_tuple, value_tuple); + return TuplePrefix<std::tuple_size<ValueTuple>::value>::Matches(matcher_tuple, + value_tuple); } // Describes failures in matching matchers against values. If there @@ -984,7 +984,7 @@ template <typename MatcherTuple, typename ValueTuple> void ExplainMatchFailureTupleTo(const MatcherTuple& matchers, const ValueTuple& values, ::std::ostream* os) { - TuplePrefix<tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo( + TuplePrefix<std::tuple_size<MatcherTuple>::value>::ExplainMatchFailuresTo( matchers, values, os); } @@ -995,7 +995,7 @@ void ExplainMatchFailureTupleTo(const MatcherTuple& matchers, template <typename Tuple, typename Func, typename OutIter> class TransformTupleValuesHelper { private: - typedef ::testing::tuple_size<Tuple> TupleSize; + typedef ::std::tuple_size<Tuple> TupleSize; public: // For each member of tuple 't', taken in order, evaluates '*out++ = f(t)'. @@ -1008,7 +1008,7 @@ class TransformTupleValuesHelper { template <typename Tup, size_t kRemainingSize> struct IterateOverTuple { OutIter operator() (Func f, const Tup& t, OutIter out) const { - *out++ = f(::testing::get<TupleSize::value - kRemainingSize>(t)); + *out++ = f(::std::get<TupleSize::value - kRemainingSize>(t)); return IterateOverTuple<Tup, kRemainingSize - 1>()(f, t, out); } }; @@ -1597,19 +1597,19 @@ class MatchesRegexMatcher { // compared don't have to have the same type. // // The matcher defined here is polymorphic (for example, Eq() can be -// used to match a tuple<int, short>, a tuple<const long&, double>, +// used to match a std::tuple<int, short>, a std::tuple<const long&, double>, // etc). Therefore we use a template type conversion operator in the // implementation. template <typename D, typename Op> class PairMatchBase { public: template <typename T1, typename T2> - operator Matcher< ::testing::tuple<T1, T2> >() const { - return MakeMatcher(new Impl< ::testing::tuple<T1, T2> >); + operator Matcher<::std::tuple<T1, T2>>() const { + return MakeMatcher(new Impl<::std::tuple<T1, T2>>); } template <typename T1, typename T2> - operator Matcher<const ::testing::tuple<T1, T2>&>() const { - return MakeMatcher(new Impl<const ::testing::tuple<T1, T2>&>); + operator Matcher<const ::std::tuple<T1, T2>&>() const { + return MakeMatcher(new Impl<const ::std::tuple<T1, T2>&>); } private: @@ -1623,7 +1623,7 @@ class PairMatchBase { virtual bool MatchAndExplain( Tuple args, MatchResultListener* /* listener */) const { - return Op()(::testing::get<0>(args), ::testing::get<1>(args)); + return Op()(::std::get<0>(args), ::std::get<1>(args)); } virtual void DescribeTo(::std::ostream* os) const { *os << "are " << GetDesc; @@ -1717,7 +1717,7 @@ class AllOfMatcherImpl : public MatcherInterface<GTEST_REFERENCE_TO_CONST_(T)> { public: explicit AllOfMatcherImpl(std::vector<Matcher<T> > matchers) - : matchers_(internal::move(matchers)) {} + : matchers_(std::move(matchers)) {} virtual void DescribeTo(::std::ostream* os) const { *os << "("; @@ -1772,7 +1772,6 @@ class AllOfMatcherImpl GTEST_DISALLOW_ASSIGN_(AllOfMatcherImpl); }; -#if GTEST_LANG_CXX11 // VariadicMatcher is used for the variadic implementation of // AllOf(m_1, m_2, ...) and AnyOf(m_1, m_2, ...). // CombiningMatcher<T> is used to recursively combine the provided matchers @@ -1792,7 +1791,7 @@ class VariadicMatcher { operator Matcher<T>() const { std::vector<Matcher<T> > values; CreateVariadicMatcher<T>(&values, std::integral_constant<size_t, 0>()); - return Matcher<T>(new CombiningMatcher<T>(internal::move(values))); + return Matcher<T>(new CombiningMatcher<T>(std::move(values))); } private: @@ -1808,7 +1807,7 @@ class VariadicMatcher { std::vector<Matcher<T> >*, std::integral_constant<size_t, sizeof...(Args)>) const {} - tuple<Args...> matchers_; + std::tuple<Args...> matchers_; GTEST_DISALLOW_ASSIGN_(VariadicMatcher); }; @@ -1816,34 +1815,6 @@ class VariadicMatcher { template <typename... Args> using AllOfMatcher = VariadicMatcher<AllOfMatcherImpl, Args...>; -#endif // GTEST_LANG_CXX11 - -// Used for implementing the AllOf(m_1, ..., m_n) matcher, which -// matches a value that matches all of the matchers m_1, ..., and m_n. -template <typename Matcher1, typename Matcher2> -class BothOfMatcher { - public: - BothOfMatcher(Matcher1 matcher1, Matcher2 matcher2) - : matcher1_(matcher1), matcher2_(matcher2) {} - - // This template type conversion operator allows a - // BothOfMatcher<Matcher1, Matcher2> object to match any type that - // both Matcher1 and Matcher2 can match. - template <typename T> - operator Matcher<T>() const { - std::vector<Matcher<T> > values; - values.push_back(SafeMatcherCast<T>(matcher1_)); - values.push_back(SafeMatcherCast<T>(matcher2_)); - return Matcher<T>(new AllOfMatcherImpl<T>(internal::move(values))); - } - - private: - Matcher1 matcher1_; - Matcher2 matcher2_; - - GTEST_DISALLOW_ASSIGN_(BothOfMatcher); -}; - // Implements the AnyOf(m1, m2) matcher for a particular argument type // T. We do not nest it inside the AnyOfMatcher class template, as // that will prevent different instantiations of AnyOfMatcher from @@ -1853,7 +1824,7 @@ class AnyOfMatcherImpl : public MatcherInterface<GTEST_REFERENCE_TO_CONST_(T)> { public: explicit AnyOfMatcherImpl(std::vector<Matcher<T> > matchers) - : matchers_(internal::move(matchers)) {} + : matchers_(std::move(matchers)) {} virtual void DescribeTo(::std::ostream* os) const { *os << "("; @@ -1908,40 +1879,10 @@ class AnyOfMatcherImpl GTEST_DISALLOW_ASSIGN_(AnyOfMatcherImpl); }; -#if GTEST_LANG_CXX11 // AnyOfMatcher is used for the variadic implementation of AnyOf(m_1, m_2, ...). template <typename... Args> using AnyOfMatcher = VariadicMatcher<AnyOfMatcherImpl, Args...>; -#endif // GTEST_LANG_CXX11 - -// Used for implementing the AnyOf(m_1, ..., m_n) matcher, which -// matches a value that matches at least one of the matchers m_1, ..., -// and m_n. -template <typename Matcher1, typename Matcher2> -class EitherOfMatcher { - public: - EitherOfMatcher(Matcher1 matcher1, Matcher2 matcher2) - : matcher1_(matcher1), matcher2_(matcher2) {} - - // This template type conversion operator allows a - // EitherOfMatcher<Matcher1, Matcher2> object to match any type that - // both Matcher1 and Matcher2 can match. - template <typename T> - operator Matcher<T>() const { - std::vector<Matcher<T> > values; - values.push_back(SafeMatcherCast<T>(matcher1_)); - values.push_back(SafeMatcherCast<T>(matcher2_)); - return Matcher<T>(new AnyOfMatcherImpl<T>(internal::move(values))); - } - - private: - Matcher1 matcher1_; - Matcher2 matcher2_; - - GTEST_DISALLOW_ASSIGN_(EitherOfMatcher); -}; - // Used for implementing Truly(pred), which turns a predicate into a // matcher. template <typename Predicate> @@ -2024,7 +1965,7 @@ class MatcherAsPredicate { template <typename M> class PredicateFormatterFromMatcher { public: - explicit PredicateFormatterFromMatcher(M m) : matcher_(internal::move(m)) {} + explicit PredicateFormatterFromMatcher(M m) : matcher_(std::move(m)) {} // This template () operator allows a PredicateFormatterFromMatcher // object to act as a predicate-formatter suitable for using with @@ -2068,7 +2009,7 @@ class PredicateFormatterFromMatcher { template <typename M> inline PredicateFormatterFromMatcher<M> MakePredicateFormatterFromMatcher(M matcher) { - return PredicateFormatterFromMatcher<M>(internal::move(matcher)); + return PredicateFormatterFromMatcher<M>(std::move(matcher)); } // Implements the polymorphic floating point equality matcher, which matches @@ -2249,14 +2190,14 @@ class FloatingEq2Matcher { } template <typename T1, typename T2> - operator Matcher< ::testing::tuple<T1, T2> >() const { + operator Matcher<::std::tuple<T1, T2>>() const { return MakeMatcher( - new Impl< ::testing::tuple<T1, T2> >(max_abs_error_, nan_eq_nan_)); + new Impl<::std::tuple<T1, T2>>(max_abs_error_, nan_eq_nan_)); } template <typename T1, typename T2> - operator Matcher<const ::testing::tuple<T1, T2>&>() const { + operator Matcher<const ::std::tuple<T1, T2>&>() const { return MakeMatcher( - new Impl<const ::testing::tuple<T1, T2>&>(max_abs_error_, nan_eq_nan_)); + new Impl<const ::std::tuple<T1, T2>&>(max_abs_error_, nan_eq_nan_)); } private: @@ -2274,14 +2215,14 @@ class FloatingEq2Matcher { virtual bool MatchAndExplain(Tuple args, MatchResultListener* listener) const { if (max_abs_error_ == -1) { - FloatingEqMatcher<FloatType> fm(::testing::get<0>(args), nan_eq_nan_); - return static_cast<Matcher<FloatType> >(fm).MatchAndExplain( - ::testing::get<1>(args), listener); + FloatingEqMatcher<FloatType> fm(::std::get<0>(args), nan_eq_nan_); + return static_cast<Matcher<FloatType>>(fm).MatchAndExplain( + ::std::get<1>(args), listener); } else { - FloatingEqMatcher<FloatType> fm(::testing::get<0>(args), nan_eq_nan_, + FloatingEqMatcher<FloatType> fm(::std::get<0>(args), nan_eq_nan_, max_abs_error_); - return static_cast<Matcher<FloatType> >(fm).MatchAndExplain( - ::testing::get<1>(args), listener); + return static_cast<Matcher<FloatType>>(fm).MatchAndExplain( + ::std::get<1>(args), listener); } } virtual void DescribeTo(::std::ostream* os) const { @@ -2628,7 +2569,7 @@ template <typename Callable, typename InnerMatcher> class ResultOfMatcher { public: ResultOfMatcher(Callable callable, InnerMatcher matcher) - : callable_(internal::move(callable)), matcher_(internal::move(matcher)) { + : callable_(std::move(callable)), matcher_(std::move(matcher)) { CallableTraits<Callable>::CheckIsValid(callable_); } @@ -2985,7 +2926,7 @@ class WhenSortedByMatcher { }; // Implements Pointwise(tuple_matcher, rhs_container). tuple_matcher -// must be able to be safely cast to Matcher<tuple<const T1&, const +// must be able to be safely cast to Matcher<std::tuple<const T1&, const // T2&> >, where T1 and T2 are the types of elements in the LHS // container and the RHS container respectively. template <typename TupleMatcher, typename RhsContainer> @@ -3030,7 +2971,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 ::testing::tuple<const LhsValue&, const RhsValue&> InnerMatcherArg; + typedef ::std::tuple<const LhsValue&, const RhsValue&> InnerMatcherArg; Impl(const TupleMatcher& tuple_matcher, const RhsStlContainer& rhs) // mono_tuple_matcher_ holds a monomorphic version of the tuple matcher. @@ -3829,7 +3770,7 @@ class UnorderedElementsAreMatcher { typedef typename View::value_type Element; typedef ::std::vector<Matcher<const Element&> > MatcherVec; MatcherVec matchers; - matchers.reserve(::testing::tuple_size<MatcherTuple>::value); + matchers.reserve(::std::tuple_size<MatcherTuple>::value); TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_, ::std::back_inserter(matchers)); return MakeMatcher(new UnorderedElementsAreMatcherImpl<Container>( @@ -3851,7 +3792,7 @@ class ElementsAreMatcher { operator Matcher<Container>() const { GTEST_COMPILE_ASSERT_( !IsHashTable<GTEST_REMOVE_REFERENCE_AND_CONST_(Container)>::value || - ::testing::tuple_size<MatcherTuple>::value < 2, + ::std::tuple_size<MatcherTuple>::value < 2, use_UnorderedElementsAre_with_hash_tables); typedef GTEST_REMOVE_REFERENCE_AND_CONST_(Container) RawContainer; @@ -3859,7 +3800,7 @@ class ElementsAreMatcher { typedef typename View::value_type Element; typedef ::std::vector<Matcher<const Element&> > MatcherVec; MatcherVec matchers; - matchers.reserve(::testing::tuple_size<MatcherTuple>::value); + matchers.reserve(::std::tuple_size<MatcherTuple>::value); TransformTupleValues(CastAndAppendTransform<const Element&>(), matchers_, ::std::back_inserter(matchers)); return MakeMatcher(new ElementsAreMatcherImpl<Container>( @@ -3952,7 +3893,7 @@ class BoundSecondMatcher { template <typename T> class Impl : public MatcherInterface<T> { public: - typedef ::testing::tuple<T, Second> ArgTuple; + typedef ::std::tuple<T, Second> ArgTuple; Impl(const Tuple2Matcher& tm, const Second& second) : mono_tuple2_matcher_(SafeMatcherCast<const ArgTuple&>(tm)), @@ -4067,11 +4008,12 @@ template <typename T> class VariantMatcher { public: explicit VariantMatcher(::testing::Matcher<const T&> matcher) - : matcher_(internal::move(matcher)) {} + : matcher_(std::move(matcher)) {} template <typename Variant> bool MatchAndExplain(const Variant& value, ::testing::MatchResultListener* listener) const { + using std::get; if (!listener->IsInterested()) { return holds_alternative<T>(value) && matcher_.Matches(get<T>(value)); } @@ -4562,7 +4504,7 @@ template <typename Callable, typename InnerMatcher> internal::ResultOfMatcher<Callable, InnerMatcher> ResultOf( Callable callable, InnerMatcher matcher) { return internal::ResultOfMatcher<Callable, InnerMatcher>( - internal::move(callable), internal::move(matcher)); + std::move(callable), std::move(matcher)); } // String matchers. @@ -4846,7 +4788,7 @@ WhenSorted(const ContainerMatcher& container_matcher) { // Matches an STL-style container or a native array that contains the // same number of elements as in rhs, where its i-th element and rhs's // i-th element (as a pair) satisfy the given pair matcher, for all i. -// TupleMatcher must be able to be safely cast to Matcher<tuple<const +// TupleMatcher must be able to be safely cast to Matcher<std::tuple<const // T1&, const T2&> >, where T1 and T2 are the types of elements in the // LHS container and the RHS container respectively. template <typename TupleMatcher, typename Container> @@ -4877,7 +4819,7 @@ inline internal::PointwiseMatcher<TupleMatcher, std::vector<T> > Pointwise( // elements as in rhs, where in some permutation of the container, its // i-th element and rhs's i-th element (as a pair) satisfy the given // pair matcher, for all i. Tuple2Matcher must be able to be safely -// cast to Matcher<tuple<const T1&, const T2&> >, where T1 and T2 are +// cast to Matcher<std::tuple<const T1&, const T2&> >, where T1 and T2 are // the types of elements in the LHS container and the RHS container // respectively. // @@ -5169,25 +5111,24 @@ std::string DescribeMatcher(const M& matcher, bool negation = false) { } template <typename... Args> -internal::ElementsAreMatcher<tuple<typename std::decay<const Args&>::type...>> +internal::ElementsAreMatcher< + std::tuple<typename std::decay<const Args&>::type...>> ElementsAre(const Args&... matchers) { return internal::ElementsAreMatcher< - tuple<typename std::decay<const Args&>::type...>>( - make_tuple(matchers...)); + std::tuple<typename std::decay<const Args&>::type...>>( + std::make_tuple(matchers...)); } template <typename... Args> internal::UnorderedElementsAreMatcher< - tuple<typename std::decay<const Args&>::type...>> + std::tuple<typename std::decay<const Args&>::type...>> UnorderedElementsAre(const Args&... matchers) { return internal::UnorderedElementsAreMatcher< - tuple<typename std::decay<const Args&>::type...>>( - make_tuple(matchers...)); + std::tuple<typename std::decay<const Args&>::type...>>( + std::make_tuple(matchers...)); } -#if GTEST_LANG_CXX11 -// Define variadic matcher versions. They are overloaded in -// gmock-generated-matchers.h for the cases supported by pre C++11 compilers. +// Define variadic matcher versions. template <typename... Args> internal::AllOfMatcher<typename std::decay<const Args&>::type...> AllOf( const Args&... matchers) { @@ -5202,8 +5143,6 @@ internal::AnyOfMatcher<typename std::decay<const Args&>::type...> AnyOf( matchers...); } -#endif // GTEST_LANG_CXX11 - // AllArgs(m) is a synonym of m. This is useful in // // EXPECT_CALL(foo, Bar(_, _)).With(AllArgs(Eq())); diff --git a/googlemock/include/gmock/gmock-more-actions.h b/googlemock/include/gmock/gmock-more-actions.h index 4d9a28ea..5c6dc8bb 100644 --- a/googlemock/include/gmock/gmock-more-actions.h +++ b/googlemock/include/gmock/gmock-more-actions.h @@ -162,7 +162,7 @@ WithArg(const InnerAction& action) { ACTION_TEMPLATE(ReturnArg, HAS_1_TEMPLATE_PARAMS(int, k), AND_0_VALUE_PARAMS()) { - return ::testing::get<k>(args); + return ::std::get<k>(args); } // Action SaveArg<k>(pointer) saves the k-th (0-based) argument of the @@ -170,7 +170,7 @@ ACTION_TEMPLATE(ReturnArg, ACTION_TEMPLATE(SaveArg, HAS_1_TEMPLATE_PARAMS(int, k), AND_1_VALUE_PARAMS(pointer)) { - *pointer = ::testing::get<k>(args); + *pointer = ::std::get<k>(args); } // Action SaveArgPointee<k>(pointer) saves the value pointed to @@ -178,7 +178,7 @@ ACTION_TEMPLATE(SaveArg, ACTION_TEMPLATE(SaveArgPointee, HAS_1_TEMPLATE_PARAMS(int, k), AND_1_VALUE_PARAMS(pointer)) { - *pointer = *::testing::get<k>(args); + *pointer = *::std::get<k>(args); } // Action SetArgReferee<k>(value) assigns 'value' to the variable @@ -186,13 +186,13 @@ ACTION_TEMPLATE(SaveArgPointee, ACTION_TEMPLATE(SetArgReferee, HAS_1_TEMPLATE_PARAMS(int, k), AND_1_VALUE_PARAMS(value)) { - typedef typename ::testing::tuple_element<k, args_type>::type argk_type; + typedef typename ::std::tuple_element<k, args_type>::type argk_type; // Ensures that argument #k is a reference. If you get a compiler // error on the next line, you are using SetArgReferee<k>(value) in // a mock function whose k-th (0-based) argument is not a reference. GTEST_COMPILE_ASSERT_(internal::is_reference<argk_type>::value, SetArgReferee_must_be_used_with_a_reference_argument); - ::testing::get<k>(args) = value; + ::std::get<k>(args) = value; } // Action SetArrayArgument<k>(first, last) copies the elements in @@ -205,9 +205,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, ::testing::get<k>(args)); + internal::CopyElements(first, last, ::std::get<k>(args)); #else - ::std::copy(first, last, ::testing::get<k>(args)); + ::std::copy(first, last, ::std::get<k>(args)); #endif } @@ -216,7 +216,7 @@ ACTION_TEMPLATE(SetArrayArgument, ACTION_TEMPLATE(DeleteArg, HAS_1_TEMPLATE_PARAMS(int, k), AND_0_VALUE_PARAMS()) { - delete ::testing::get<k>(args); + delete ::std::get<k>(args); } // This action returns the value pointed to by 'pointer'. diff --git a/googlemock/include/gmock/gmock-spec-builders.h b/googlemock/include/gmock/gmock-spec-builders.h index c8e864cc..849bc92a 100644 --- a/googlemock/include/gmock/gmock-spec-builders.h +++ b/googlemock/include/gmock/gmock-spec-builders.h @@ -65,6 +65,7 @@ #include <set> #include <sstream> #include <string> +#include <utility> #include <vector> #include "gmock/gmock-actions.h" #include "gmock/gmock-cardinalities.h" @@ -1184,9 +1185,10 @@ class TypedExpectation : public ExpectationBase { Log(kWarning, ss.str(), 1); } - return count <= action_count ? - *static_cast<const Action<F>*>(untyped_actions_[count - 1]) : - repeated_action(); + return count <= action_count + ? *static_cast<const Action<F>*>( + untyped_actions_[static_cast<size_t>(count - 1)]) + : repeated_action(); } // Given the arguments of a mock function call, if the call will @@ -1319,13 +1321,13 @@ class ReferenceOrValueWrapper { public: // Constructs a wrapper from the given value/reference. explicit ReferenceOrValueWrapper(T value) - : value_(::testing::internal::move(value)) { + : value_(std::move(value)) { } // Unwraps and returns the underlying value/reference, exactly as // originally passed. The behavior of calling this more than once on // the same object is unspecified. - T Unwrap() { return ::testing::internal::move(value_); } + T Unwrap() { return std::move(value_); } // Provides nondestructive access to the underlying value/reference. // Always returns a const reference (more precisely, @@ -1400,27 +1402,26 @@ class ActionResultHolder : public UntypedActionResultHolderBase { template <typename F> static ActionResultHolder* PerformDefaultAction( const FunctionMockerBase<F>* func_mocker, - typename RvalueRef<typename Function<F>::ArgumentTuple>::type args, + typename Function<F>::ArgumentTuple&& args, const std::string& call_description) { return new ActionResultHolder(Wrapper(func_mocker->PerformDefaultAction( - internal::move(args), call_description))); + std::move(args), call_description))); } // Performs the given action and returns the result in a new-ed // ActionResultHolder. template <typename F> static ActionResultHolder* PerformAction( - const Action<F>& action, - typename RvalueRef<typename Function<F>::ArgumentTuple>::type args) { + const Action<F>& action, typename Function<F>::ArgumentTuple&& args) { return new ActionResultHolder( - Wrapper(action.Perform(internal::move(args)))); + Wrapper(action.Perform(std::move(args)))); } private: typedef ReferenceOrValueWrapper<T> Wrapper; explicit ActionResultHolder(Wrapper result) - : result_(::testing::internal::move(result)) { + : result_(std::move(result)) { } Wrapper result_; @@ -1441,9 +1442,9 @@ class ActionResultHolder<void> : public UntypedActionResultHolderBase { template <typename F> static ActionResultHolder* PerformDefaultAction( const FunctionMockerBase<F>* func_mocker, - typename RvalueRef<typename Function<F>::ArgumentTuple>::type args, + typename Function<F>::ArgumentTuple&& args, const std::string& call_description) { - func_mocker->PerformDefaultAction(internal::move(args), call_description); + func_mocker->PerformDefaultAction(std::move(args), call_description); return new ActionResultHolder; } @@ -1451,9 +1452,8 @@ class ActionResultHolder<void> : public UntypedActionResultHolderBase { // ActionResultHolder*. template <typename F> static ActionResultHolder* PerformAction( - const Action<F>& action, - typename RvalueRef<typename Function<F>::ArgumentTuple>::type args) { - action.Perform(internal::move(args)); + const Action<F>& action, typename Function<F>::ArgumentTuple&& args) { + action.Perform(std::move(args)); return new ActionResultHolder; } @@ -1508,13 +1508,12 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { // mutable state of this object, and thus can be called concurrently // without locking. // L = * - Result PerformDefaultAction( - typename RvalueRef<typename Function<F>::ArgumentTuple>::type args, - const std::string& call_description) const { + Result PerformDefaultAction(typename Function<F>::ArgumentTuple&& args, + const std::string& call_description) const { const OnCallSpec<F>* const spec = this->FindOnCallSpec(args); if (spec != nullptr) { - return spec->GetAction().Perform(internal::move(args)); + return spec->GetAction().Perform(std::move(args)); } const std::string message = call_description + @@ -1539,7 +1538,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { void* untyped_args, // must point to an ArgumentTuple const std::string& call_description) const { ArgumentTuple* args = static_cast<ArgumentTuple*>(untyped_args); - return ResultHolder::PerformDefaultAction(this, internal::move(*args), + return ResultHolder::PerformDefaultAction(this, std::move(*args), call_description); } @@ -1553,7 +1552,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { // action deletes the mock object (and thus deletes itself). const Action<F> action = *static_cast<const Action<F>*>(untyped_action); ArgumentTuple* args = static_cast<ArgumentTuple*>(untyped_args); - return ResultHolder::PerformAction(action, internal::move(*args)); + return ResultHolder::PerformAction(action, std::move(*args)); } // Implements UntypedFunctionMockerBase::ClearDefaultActionsLocked(): @@ -1593,8 +1592,7 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { // Returns the result of invoking this mock function with the given // arguments. This function can be safely called from multiple // threads concurrently. - Result InvokeWith( - typename RvalueRef<typename Function<F>::ArgumentTuple>::type args) + Result InvokeWith(typename Function<F>::ArgumentTuple&& args) GTEST_LOCK_EXCLUDED_(g_gmock_mutex) { // const_cast is required since in C++98 we still pass ArgumentTuple around // by const& instead of rvalue reference. @@ -1762,12 +1760,12 @@ class FunctionMockerBase : public UntypedFunctionMockerBase { ::std::ostream* why) const GTEST_EXCLUSIVE_LOCK_REQUIRED_(g_gmock_mutex) { g_gmock_mutex.AssertHeld(); - const int count = static_cast<int>(untyped_expectations_.size()); + const size_t count = untyped_expectations_.size(); *why << "Google Mock tried the following " << count << " " << (count == 1 ? "expectation, but it didn't match" : "expectations, but none matched") << ":\n"; - for (int i = 0; i < count; i++) { + for (size_t i = 0; i < count; i++) { TypedExpectation<F>* const expectation = static_cast<TypedExpectation<F>*>(untyped_expectations_[i].get()); *why << "\n"; diff --git a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h index eaa56be9..efa04629 100644 --- a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h @@ -70,79 +70,71 @@ template <typename Tuple> struct MatcherTuple; template <> -struct MatcherTuple< ::testing::tuple<> > { - typedef ::testing::tuple< > type; +struct MatcherTuple< ::std::tuple<> > { + typedef ::std::tuple< > type; }; template <typename A1> -struct MatcherTuple< ::testing::tuple<A1> > { - typedef ::testing::tuple<Matcher<A1> > type; +struct MatcherTuple< ::std::tuple<A1> > { + typedef ::std::tuple<Matcher<A1> > type; }; template <typename A1, typename A2> -struct MatcherTuple< ::testing::tuple<A1, A2> > { - typedef ::testing::tuple<Matcher<A1>, Matcher<A2> > type; +struct MatcherTuple< ::std::tuple<A1, A2> > { + typedef ::std::tuple<Matcher<A1>, Matcher<A2> > type; }; template <typename A1, typename A2, typename A3> -struct MatcherTuple< ::testing::tuple<A1, A2, A3> > { - typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type; +struct MatcherTuple< ::std::tuple<A1, A2, A3> > { + typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3> > type; }; template <typename A1, typename A2, typename A3, typename A4> -struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4> > { - typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4> > - type; +struct MatcherTuple< ::std::tuple<A1, A2, A3, A4> > { + typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, + Matcher<A4> > type; }; template <typename A1, typename A2, typename A3, typename A4, typename A5> -struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5> > { - typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, - Matcher<A5> > - type; +struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5> > { + typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, + Matcher<A5> > type; }; template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6> -struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6> > { - typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, - Matcher<A5>, Matcher<A6> > - type; +struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6> > { + typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, + Matcher<A5>, Matcher<A6> > type; }; template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7> -struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> > { - typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, - Matcher<A5>, Matcher<A6>, Matcher<A7> > - type; +struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6, A7> > { + typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, + Matcher<A5>, Matcher<A6>, Matcher<A7> > type; }; template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8> -struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > { - typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, - Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> > - type; +struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8> > { + typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, + Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8> > type; }; template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9> -struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > { - typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, - Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, - Matcher<A9> > - type; +struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> > { + typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, + Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9> > type; }; template <typename A1, typename A2, typename A3, typename A4, typename A5, typename A6, typename A7, typename A8, typename A9, typename A10> -struct MatcherTuple< ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, - A10> > { - typedef ::testing::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, - Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, - Matcher<A9>, Matcher<A10> > - type; +struct MatcherTuple< ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> > { + typedef ::std::tuple<Matcher<A1>, Matcher<A2>, Matcher<A3>, Matcher<A4>, + Matcher<A5>, Matcher<A6>, Matcher<A7>, Matcher<A8>, Matcher<A9>, + Matcher<A10> > type; }; // Template struct Function<F>, where F must be a function type, contains @@ -164,7 +156,7 @@ struct Function; template <typename R> struct Function<R()> { typedef R Result; - typedef ::testing::tuple<> ArgumentTuple; + typedef ::std::tuple<> ArgumentTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef void MakeResultVoid(); typedef IgnoredValue MakeResultIgnoredValue(); @@ -174,7 +166,7 @@ template <typename R, typename A1> struct Function<R(A1)> : Function<R()> { typedef A1 Argument1; - typedef ::testing::tuple<A1> ArgumentTuple; + typedef ::std::tuple<A1> ArgumentTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1); typedef IgnoredValue MakeResultIgnoredValue(A1); @@ -184,7 +176,7 @@ template <typename R, typename A1, typename A2> struct Function<R(A1, A2)> : Function<R(A1)> { typedef A2 Argument2; - typedef ::testing::tuple<A1, A2> ArgumentTuple; + typedef ::std::tuple<A1, A2> ArgumentTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2); typedef IgnoredValue MakeResultIgnoredValue(A1, A2); @@ -194,7 +186,7 @@ template <typename R, typename A1, typename A2, typename A3> struct Function<R(A1, A2, A3)> : Function<R(A1, A2)> { typedef A3 Argument3; - typedef ::testing::tuple<A1, A2, A3> ArgumentTuple; + typedef ::std::tuple<A1, A2, A3> ArgumentTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3); @@ -204,7 +196,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4> struct Function<R(A1, A2, A3, A4)> : Function<R(A1, A2, A3)> { typedef A4 Argument4; - typedef ::testing::tuple<A1, A2, A3, A4> ArgumentTuple; + typedef ::std::tuple<A1, A2, A3, A4> ArgumentTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4); @@ -215,7 +207,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4, struct Function<R(A1, A2, A3, A4, A5)> : Function<R(A1, A2, A3, A4)> { typedef A5 Argument5; - typedef ::testing::tuple<A1, A2, A3, A4, A5> ArgumentTuple; + typedef ::std::tuple<A1, A2, A3, A4, A5> ArgumentTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5); @@ -226,7 +218,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4, struct Function<R(A1, A2, A3, A4, A5, A6)> : Function<R(A1, A2, A3, A4, A5)> { typedef A6 Argument6; - typedef ::testing::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple; + typedef ::std::tuple<A1, A2, A3, A4, A5, A6> ArgumentTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6); @@ -237,7 +229,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4, struct Function<R(A1, A2, A3, A4, A5, A6, A7)> : Function<R(A1, A2, A3, A4, A5, A6)> { typedef A7 Argument7; - typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple; + typedef ::std::tuple<A1, A2, A3, A4, A5, A6, A7> ArgumentTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7); @@ -248,7 +240,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4, struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> : Function<R(A1, A2, A3, A4, A5, A6, A7)> { typedef A8 Argument8; - typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple; + typedef ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8> ArgumentTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8); @@ -259,7 +251,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4, struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> : Function<R(A1, A2, A3, A4, A5, A6, A7, A8)> { typedef A9 Argument9; - typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple; + typedef ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9> ArgumentTuple; typedef typename MatcherTuple<ArgumentTuple>::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, @@ -272,8 +264,7 @@ template <typename R, typename A1, typename A2, typename A3, typename A4, struct Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10)> : Function<R(A1, A2, A3, A4, A5, A6, A7, A8, A9)> { typedef A10 Argument10; - typedef ::testing::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, - A10> ArgumentTuple; + typedef ::std::tuple<A1, A2, A3, A4, A5, A6, A7, A8, A9, A10> ArgumentTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef void MakeResultVoid(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10); typedef IgnoredValue MakeResultIgnoredValue(A1, A2, A3, A4, A5, A6, A7, A8, diff --git a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump index c1032798..9962f6b3 100644 --- a/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump +++ b/googlemock/include/gmock/internal/gmock-generated-internal-utils.h.pump @@ -78,8 +78,8 @@ $var typename_As = [[$for j, [[typename A$j]]]] $var As = [[$for j, [[A$j]]]] $var matcher_As = [[$for j, [[Matcher<A$j>]]]] template <$typename_As> -struct MatcherTuple< ::testing::tuple<$As> > { - typedef ::testing::tuple<$matcher_As > type; +struct MatcherTuple< ::std::tuple<$As> > { + typedef ::std::tuple<$matcher_As > type; }; @@ -103,7 +103,7 @@ struct Function; template <typename R> struct Function<R()> { typedef R Result; - typedef ::testing::tuple<> ArgumentTuple; + typedef ::std::tuple<> ArgumentTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef void MakeResultVoid(); typedef IgnoredValue MakeResultIgnoredValue(); @@ -122,7 +122,7 @@ template <typename R$typename_As> struct Function<R($As)> : Function<R($prev_As)> { typedef A$i Argument$i; - typedef ::testing::tuple<$As> ArgumentTuple; + typedef ::std::tuple<$As> ArgumentTuple; typedef typename MatcherTuple<ArgumentTuple>::type ArgumentMatcherTuple; typedef void MakeResultVoid($As); typedef IgnoredValue MakeResultIgnoredValue($As); diff --git a/googlemock/include/gmock/internal/gmock-internal-utils.h b/googlemock/include/gmock/internal/gmock-internal-utils.h index db64c65c..fd33c004 100644 --- a/googlemock/include/gmock/internal/gmock-internal-utils.h +++ b/googlemock/include/gmock/internal/gmock-internal-utils.h @@ -493,7 +493,7 @@ class StlContainerView<Element[N]> { // This specialization is used when RawContainer is a native array // represented as a (pointer, size) tuple. template <typename ElementPointer, typename Size> -class StlContainerView< ::testing::tuple<ElementPointer, Size> > { +class StlContainerView< ::std::tuple<ElementPointer, Size> > { public: typedef GTEST_REMOVE_CONST_( typename internal::PointeeOf<ElementPointer>::type) RawElement; @@ -501,11 +501,12 @@ class StlContainerView< ::testing::tuple<ElementPointer, Size> > { typedef const type const_reference; static const_reference ConstReference( - const ::testing::tuple<ElementPointer, Size>& array) { - return type(get<0>(array), get<1>(array), RelationToSourceReference()); + const ::std::tuple<ElementPointer, Size>& array) { + return type(std::get<0>(array), std::get<1>(array), + RelationToSourceReference()); } - static type Copy(const ::testing::tuple<ElementPointer, Size>& array) { - return type(get<0>(array), get<1>(array), RelationToSourceCopy()); + static type Copy(const ::std::tuple<ElementPointer, Size>& array) { + return type(std::get<0>(array), std::get<1>(array), RelationToSourceCopy()); } }; |