Added logging support for std::unique_ptr, std::shared_ptr and std::weak_ptr

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@677 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2013-07-09 08:46:43 +00:00
parent 068f73b0bc
commit 808af17eb8
3 changed files with 43 additions and 0 deletions

View file

@ -127,6 +127,25 @@ namespace detail
{
return s << mock::format( t.lock() );
}
#ifdef MOCK_SMART_PTR
template< typename T >
stream& operator<<( stream& s, const std::shared_ptr< T >& t )
{
return s << mock::format( t.get() );
}
template< typename T >
stream& operator<<( stream& s, const std::weak_ptr< T >& t )
{
return s << mock::format( t.lock() );
}
template< typename T, typename Deleter >
inline stream& operator<<( stream& s, const std::unique_ptr< T, Deleter >& p )
{
return s << mock::format( p.get() );
}
#endif
template< typename T >
stream& operator<<( stream& s, const boost::lambda::lambda_functor< T >& )
{
@ -137,6 +156,7 @@ namespace detail
{
return s << '?';
}
#ifdef MOCK_NULLPTR
inline stream& operator<<( stream& s, std::nullptr_t )
{