mirror of
https://github.com/google/googletest.git
synced 2025-12-02 00:57:37 -05:00
Add ByMove() modifier for the Return() action. Pull in gtest 695.
This commit is contained in:
@@ -1302,15 +1302,12 @@ template <typename T>
|
||||
class ReferenceOrValueWrapper {
|
||||
public:
|
||||
// Constructs a wrapper from the given value/reference.
|
||||
explicit ReferenceOrValueWrapper(T value)
|
||||
: value_(GTEST_MOVE_(value)) {}
|
||||
explicit ReferenceOrValueWrapper(T value) : value_(move(value)) {}
|
||||
|
||||
// Unwraps and returns the underlying value/reference, exactly as
|
||||
// originally passed. The behavior of calling this more than once on
|
||||
// the same object is unspecified.
|
||||
T Unwrap() {
|
||||
return GTEST_MOVE_(value_);
|
||||
}
|
||||
T Unwrap() { return move(value_); }
|
||||
|
||||
// Provides nondestructive access to the underlying value/reference.
|
||||
// Always returns a const reference (more precisely,
|
||||
@@ -1407,8 +1404,7 @@ class ActionResultHolder : public UntypedActionResultHolderBase {
|
||||
private:
|
||||
typedef ReferenceOrValueWrapper<T> Wrapper;
|
||||
|
||||
explicit ActionResultHolder(Wrapper result)
|
||||
: result_(GTEST_MOVE_(result)) {}
|
||||
explicit ActionResultHolder(Wrapper result) : result_(move(result)) {}
|
||||
|
||||
Wrapper result_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user