mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Added logging support for boost::optional
This commit is contained in:
parent
c35b76c8f0
commit
506e10f76a
3 changed files with 24 additions and 0 deletions
|
|
@ -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 >
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue