mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Logging through operator<< does not perform conversions
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@249 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
e59dbf9e56
commit
cf221b928f
2 changed files with 5 additions and 9 deletions
|
|
@ -10,7 +10,6 @@
|
||||||
#define MOCK_IS_SERIALIZABLE_HPP_INCLUDED
|
#define MOCK_IS_SERIALIZABLE_HPP_INCLUDED
|
||||||
|
|
||||||
#include "yes_no_type.hpp"
|
#include "yes_no_type.hpp"
|
||||||
#include "sink.hpp"
|
|
||||||
#include <boost/mpl/bool.hpp>
|
#include <boost/mpl/bool.hpp>
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|
@ -24,17 +23,14 @@ namespace detail
|
||||||
{
|
{
|
||||||
namespace serializable
|
namespace serializable
|
||||||
{
|
{
|
||||||
template< typename S >
|
template< typename S, typename T >
|
||||||
yes_type operator<<( S&, sink );
|
yes_type operator<<( S&, const T& );
|
||||||
|
|
||||||
template< typename S, typename T >
|
template< typename S, typename T >
|
||||||
struct impl
|
struct impl
|
||||||
{
|
{
|
||||||
static S* s;
|
static S* s;
|
||||||
static T* t;
|
static T* t;
|
||||||
// if an error is generated by the line below it means T has more than
|
|
||||||
// one conversion to other types which are serializable : the easiest
|
|
||||||
// solution would be to add a format function for T.
|
|
||||||
enum { value = sizeof( yes_type(), (*s << *t), yes_type() ) == sizeof( yes_type ) };
|
enum { value = sizeof( yes_type(), (*s << *t), yes_type() ) == sizeof( yes_type ) };
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ namespace
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_MPL_ASSERT(( mock::detail::is_serializable< std::ostream, convertible_to_base > ));
|
BOOST_MPL_ASSERT_NOT(( mock::detail::is_serializable< std::ostream, convertible_to_base > ));
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
@ -80,7 +80,7 @@ namespace
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_MPL_ASSERT(( mock::detail::is_serializable< std::ostream, convertible_to_serializable > ));
|
BOOST_MPL_ASSERT_NOT(( mock::detail::is_serializable< std::ostream, convertible_to_serializable > ));
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
|
@ -88,4 +88,4 @@ namespace
|
||||||
{};
|
{};
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOST_MPL_ASSERT(( mock::detail::is_serializable< std::ostream, derived_from_serializable > ));
|
BOOST_MPL_ASSERT_NOT(( mock::detail::is_serializable< std::ostream, derived_from_serializable > ));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue