diff options
author | Dino Radakovic <dinor@google.com> | 2022-01-26 16:38:44 (GMT) |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-01-26 16:40:27 (GMT) |
commit | 0b7798b2fba340969a0cf83698e5c0a2e25b7dbc (patch) | |
tree | 281c951d5ed26682e38212aea5c5914a91b10a8f /googlemock/include | |
parent | f45d5865ed0b2b8912244627cdf508a24cc6ccb4 (diff) | |
download | googletest-0b7798b2fba340969a0cf83698e5c0a2e25b7dbc.zip googletest-0b7798b2fba340969a0cf83698e5c0a2e25b7dbc.tar.gz googletest-0b7798b2fba340969a0cf83698e5c0a2e25b7dbc.tar.bz2 |
Change `ReturnArg` to use perfect forwarding of arguments (#3733)
PiperOrigin-RevId: 424355706
Change-Id: I618e5574b4b2c56a343905c20d8cc6d2a70cbcd1
Diffstat (limited to 'googlemock/include')
-rw-r--r-- | googlemock/include/gmock/gmock-actions.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/googlemock/include/gmock/gmock-actions.h b/googlemock/include/gmock/gmock-actions.h index 72663c8..70c325a 100644 --- a/googlemock/include/gmock/gmock-actions.h +++ b/googlemock/include/gmock/gmock-actions.h @@ -1079,9 +1079,9 @@ struct ReturnNewAction { template <size_t k> struct ReturnArgAction { template <typename... Args> - auto operator()(const Args&... args) const -> - typename std::tuple_element<k, std::tuple<Args...>>::type { - return std::get<k>(std::tie(args...)); + auto operator()(Args&&... args) const -> decltype(std::get<k>( + std::forward_as_tuple(std::forward<Args>(args)...))) { + return std::get<k>(std::forward_as_tuple(std::forward<Args>(args)...)); } }; |