tesseract v5.3.3.20231005
testing::internal::ReturnAction< R > Class Template Reference

#include <gmock-actions.h>

Public Member Functions

 ReturnAction (R value)
 
template<typename F >
 operator Action< F > () const
 

Detailed Description

template<typename R>
class testing::internal::ReturnAction< R >

Definition at line 637 of file gmock-actions.h.

Constructor & Destructor Documentation

◆ ReturnAction()

template<typename R >
testing::internal::ReturnAction< R >::ReturnAction ( value)
inlineexplicit

Definition at line 642 of file gmock-actions.h.

642: value_(new R(std::move(value))) {}
int value

Member Function Documentation

◆ operator Action< F >()

template<typename R >
template<typename F >
testing::internal::ReturnAction< R >::operator Action< F > ( ) const
inline

Definition at line 647 of file gmock-actions.h.

647 { // NOLINT
648 // Assert statement belongs here because this is the best place to verify
649 // conditions on F. It produces the clearest error messages
650 // in most compilers.
651 // Impl really belongs in this scope as a local class but can't
652 // because MSVC produces duplicate symbols in different translation units
653 // in this case. Until MS fixes that bug we put Impl into the class scope
654 // and put the typedef both here (for use in assert statement) and
655 // in the Impl class. But both definitions must be the same.
656 typedef typename Function<F>::Result Result;
659 use_ReturnRef_instead_of_Return_to_return_a_reference);
660 static_assert(!std::is_void<Result>::value,
661 "Can't use Return() on an action expected to return `void`.");
662 return Action<F>(new Impl<R, F>(value_));
663 }
#define GTEST_COMPILE_ASSERT_(expr, msg)
Definition: gtest-port.h:879

The documentation for this class was generated from the following file: