Added MOCK_NO_AUTO_PTR to deactivate std::auto_ptr support

This commit is contained in:
Mathieu Champlon 2017-03-20 11:43:18 +01:00
parent 238fff3fe2
commit a22ca57253
8 changed files with 29 additions and 3 deletions

View file

@ -82,4 +82,10 @@
# endif
#endif
#if !defined(BOOST_NO_AUTO_PTR)
# ifndef MOCK_NO_AUTO_PTR
# define MOCK_AUTO_PTR
# endif
#endif
#endif // MOCK_CONFIG_HPP_INCLUDED

View file

@ -173,6 +173,7 @@ namespace detail
{}
};
#ifdef MOCK_AUTO_PTR
template< typename Result, typename Signature >
class action< std::auto_ptr< Result >, Signature >
: public action_base< std::auto_ptr< Result >, Signature >
@ -208,6 +209,7 @@ namespace detail
private:
mutable std::auto_ptr< Result > v_;
};
#endif // MOCK_AUTO_PTR
}
} // mock

View file

@ -53,11 +53,14 @@ namespace detail
}
}
#ifdef MOCK_AUTO_PTR
template< typename T >
stream& operator<<( stream& s, const std::auto_ptr< T >& t )
{
return s << mock::format( t.get() );
}
#endif // MOCK_AUTO_PTR
template< typename T1, typename T2 >
stream& operator<<( stream& s, const std::pair< T1, T2 >& p )
{