Added support for nullptr as constraint

git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@648 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
mat007 2013-05-12 08:59:25 +00:00
parent 42c2c4e6a4
commit 1320a96179
12 changed files with 96 additions and 10 deletions

View file

@ -0,0 +1,35 @@
// http://turtle.sourceforge.net
//
// Copyright Mathieu Champlon 2013
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef MOCK_ADDRESSOF_HPP_INCLUDED
#define MOCK_ADDRESSOF_HPP_INCLUDED
#include <boost/utility/addressof.hpp>
namespace mock
{
namespace detail
{
using boost::addressof;
#if !defined(BOOST_NO_CXX11_NULLPTR) && !defined(BOOST_NO_NULLPTR)
inline const std::nullptr_t* addressof( const std::nullptr_t& p )
{
return &p;
}
inline std::nullptr_t* addressof( std::nullptr_t& p )
{
return &p;
}
#endif
}
} // mock
#endif // MOCK_ADDRESSOF_HPP_INCLUDED

View file

@ -11,7 +11,7 @@
#include "../config.hpp"
#include "../stream.hpp"
#include <boost/utility/addressof.hpp>
#include "addressof.hpp"
namespace mock
{
@ -21,7 +21,7 @@ namespace detail
struct formatter
{
explicit formatter( const T& t )
: t_( boost::addressof( t ) )
: t_( detail::addressof( t ) )
{}
void serialize( stream& s ) const
{