Added support for movable objects in mock::retrieve

This commit is contained in:
Mathieu Champlon 2017-12-11 22:04:11 +01:00
parent afffdb470a
commit f872785e26
3 changed files with 18 additions and 0 deletions

View file

@ -14,6 +14,7 @@
#include "detail/addressof.hpp"
#include <boost/ref.hpp>
#include <boost/version.hpp>
#include <boost/move/move.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/common_type.hpp>
#include <boost/type_traits/is_convertible.hpp>
@ -157,6 +158,12 @@ namespace detail
*expected_ = detail::addressof( actual );
return true;
}
template< typename Actual >
bool operator()( BOOST_RV_REF( Actual ) actual ) const
{
*expected_ = boost::move( actual );
return true;
}
friend std::ostream& operator<<( std::ostream& s, const retrieve& r )
{
return s << "retrieve( " << mock::format( *r.expected_ ) << " )";