Added logging support for boost::optional

This commit is contained in:
Mathieu Champlon 2016-02-08 05:40:39 +01:00
parent c35b76c8f0
commit 506e10f76a
3 changed files with 24 additions and 0 deletions

View file

@ -15,6 +15,7 @@
#include <boost/utility/enable_if.hpp>
#include <boost/detail/container_fwd.hpp>
#include <boost/function_types/is_callable_builtin.hpp>
#include <boost/none.hpp>
#include <memory>
namespace boost
@ -22,6 +23,7 @@ namespace boost
template< typename T > class shared_ptr;
template< typename T > class weak_ptr;
template< typename T > class reference_wrapper;
template< typename T > class optional;
namespace phoenix
{
@ -127,6 +129,17 @@ namespace detail
{
return s << mock::format( t.lock() );
}
inline stream& operator<<( stream& s, const boost::none_t& )
{
return s << "none";
}
template< typename T >
stream& operator<<( stream& s, const boost::optional< T >& t )
{
if( t )
return s << mock::format( t.get() );
return s << boost::none;
}
#ifdef MOCK_SMART_PTR
template< typename T >