Googletest export

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

Replace InvokeArgumentAdl with Invoke that uses C++11 variadic templates.

PiperOrigin-RevId: 288449236
This commit is contained in:
Abseil Team
2020-01-07 03:51:16 -05:00
committed by Andy Soffer
parent 306f3754a7
commit 4b9c1691c4
3 changed files with 42 additions and 134 deletions

View File

@@ -1222,6 +1222,22 @@ 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 F, typename... Args>
auto InvokeArgumentAdl(AdlTag, F f, Args... args) -> decltype(f(args...)) {
return f(args...);
}
} // namespace invoke_argument
} // namespace internal
} // namespace testing