aboutsummaryrefslogtreecommitdiffstats
path: root/googlemock/include/gmock/gmock-actions.h
diff options
context:
space:
mode:
authorAbseil Team <absl-team@google.com>2020-01-07 03:51:16 -0500
committerAndy Soffer <asoffer@google.com>2020-01-09 18:25:08 -0500
commit4b9c1691c4b7f01fbd9d37d86c88cdad298d48e9 (patch)
tree5722c708d3b9e1d5c0ca8bafbf4c595e3172d68c /googlemock/include/gmock/gmock-actions.h
parent306f3754a71d6d1ac644681d3544d06744914228 (diff)
downloadgoogletest-4b9c1691c4b7f01fbd9d37d86c88cdad298d48e9.tar.gz
googletest-4b9c1691c4b7f01fbd9d37d86c88cdad298d48e9.tar.bz2
googletest-4b9c1691c4b7f01fbd9d37d86c88cdad298d48e9.zip
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
Diffstat (limited to 'googlemock/include/gmock/gmock-actions.h')
-rw-r--r--googlemock/include/gmock/gmock-actions.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h
index 4b8dcebb..11223cf2 100644
--- a/googlemock/include/gmock/gmock-actions.h
+++ b/googlemock/include/gmock/gmock-actions.h
@@ -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