Googletest export

Use C++11 variadic templates for InvokeArgumentAdl in gmock-generated-actions.h.

Make InvokeArgumentAdl use variadic templates to generate its overloads instead
of using pump.py syntax.

PiperOrigin-RevId: 286148805
This commit is contained in:
Abseil Team
2020-01-02 16:48:34 -05:00
committed by Andy Soffer
parent d166e09483
commit 6f1a8ffde9
3 changed files with 17 additions and 98 deletions
+17
View File
@@ -1222,6 +1222,23 @@ class ActionHelper {
}
};
namespace invoke_argument {
// Appears in InvokeArgumentAdl's argument list to help avoid
// accidental calls to user functions of the same name.
struct AdlTag {};
// InvokeArgumentAdl - a helper for InvokeArgument.
// The basic overloads are provided here for generic functors.
// Overloads for other custom-callables are provided in the
// internal/custom/gmock-generated-actions.h header.
template <typename R, typename F, typename... Args>
R InvokeArgumentAdl(AdlTag, F f, Args&&... args) {
return f(std::forward<Args>(args)...);
}
} // namespace invoke_argument
} // namespace internal
} // namespace testing