diff options
author | Aaron Jacobs <jacobsa@google.com> | 2022-05-10 20:08:19 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-05-10 20:08:51 -0700 |
commit | 6386897feb0a3f4fbe104fe1fa4570ec8158d9e5 (patch) | |
tree | cb6d08bbb74311f40fb3784b50c60b8478ee0ab6 /googlemock/include | |
parent | bda85449f48f2d80a494c8c07766b6aba3170f3b (diff) | |
download | googletest-git-6386897feb0a3f4fbe104fe1fa4570ec8158d9e5.tar.gz |
gmock-actions: make OnceAction public.
So that it can be referenced in conversion operators for actions that need to
know the concrete return type.
PiperOrigin-RevId: 447889344
Change-Id: I643d3298bc8effd08741282a956c221f9d67d378
Diffstat (limited to 'googlemock/include')
-rw-r--r-- | googlemock/include/gmock/gmock-actions.h | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index c83a99ad..e022c124 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -322,16 +322,18 @@ struct is_callable_r_impl<void_t<call_result_t<F, Args...>>, R, F, Args...> template <typename R, typename F, typename... Args> using is_callable_r = is_callable_r_impl<void, R, F, Args...>; +} // namespace internal + // Specialized for function types below. template <typename F> class OnceAction; // An action that can only be used once. // -// This is what is accepted by WillOnce, which doesn't require the underlying -// action to be copy-constructible (only move-constructible), and promises to -// invoke it as an rvalue reference. This allows the action to work with -// move-only types like std::move_only_function in a type-safe manner. +// This is accepted by WillOnce, which doesn't require the underlying action to +// be copy-constructible (only move-constructible), and promises to invoke it as +// an rvalue reference. This allows the action to work with move-only types like +// std::move_only_function in a type-safe manner. // // For example: // @@ -501,8 +503,6 @@ class OnceAction<Result(Args...)> final { std::function<Result(Args...)> function_; }; -} // namespace internal - // When an unexpected function call is encountered, Google Mock will // let it return a default value if the user has specified one for its // return type, or if the return type has a built-in default value; @@ -742,7 +742,7 @@ class Action<R(Args...)> { // An action can be used as a OnceAction, since it's obviously safe to call it // once. - operator internal::OnceAction<F>() const { // NOLINT + operator OnceAction<F>() const { // NOLINT // Return a OnceAction-compatible callable that calls Perform with the // arguments it is provided. We could instead just return fun_, but then // we'd need to handle the IsDoDefault() case separately. |