template <typename T>

class ReferenceOrValueWrapper

Defined at line 1343 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h

Wrapper type for generically holding an ordinary value or lvalue reference.

If T is not a reference type, it must be copyable or movable.

ReferenceOrValueWrapper

<T

> is movable, and will also be copyable unless

T is a move-only value type (which means that it will always be copyable

if the current platform does not support move semantics).

The primary template defines handling for values, but function header

comments describe the contract for the whole template (including

specializations).

Public Methods

void ReferenceOrValueWrapper<T> (T value)

Constructs a wrapper from the given value/reference.

Defined at line 1346 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h

T Unwrap ()

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.

Defined at line 1351 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h

const T & Peek ()

Provides nondestructive access to the underlying value/reference.

Always returns a const reference (more precisely,

const std::add_lvalue_reference

<T

>::type). The behavior of calling this

after calling Unwrap on the same object is unspecified.

Defined at line 1357 of file ../../third_party/googletest/src/googlemock/include/gmock/gmock-spec-builders.h