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:
mat007 2011-02-21 08:15:01 +00:00
parent e59dbf9e56
commit cf221b928f
2 changed files with 5 additions and 9 deletions

View file

@ -10,7 +10,6 @@
#define MOCK_IS_SERIALIZABLE_HPP_INCLUDED
#include "yes_no_type.hpp"
#include "sink.hpp"
#include <boost/mpl/bool.hpp>
#ifdef _MSC_VER
@ -24,17 +23,14 @@ namespace detail
{
namespace serializable
{
template< typename S >
yes_type operator<<( S&, sink );
template< typename S, typename T >
yes_type operator<<( S&, const T& );
template< typename S, typename T >
struct impl
{
static S* s;
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 ) };
};
}

View file

@ -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
{
@ -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
{
@ -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 > ));