mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Clean-up
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@16 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
7781ba4e58
commit
8015fb8a9f
3 changed files with 14 additions and 25 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#include <boost/type_traits.hpp>
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
#include <sstream>
|
||||
#include <ostream>
|
||||
|
||||
|
|
@ -31,29 +32,17 @@ namespace detail
|
|||
template< typename S >
|
||||
eaten operator<<( S&, const eater& );
|
||||
|
||||
template< int I >
|
||||
struct selector
|
||||
{};
|
||||
template<>
|
||||
struct selector< sizeof( std::ostream& ) >
|
||||
template< typename T >
|
||||
struct is_serializable_impl
|
||||
{
|
||||
typedef boost::true_type type;
|
||||
};
|
||||
template<>
|
||||
struct selector< sizeof( eaten ) >
|
||||
{
|
||||
typedef boost::false_type type;
|
||||
static std::ostream* s;
|
||||
static T* t;
|
||||
enum { value = sizeof( *s << *t ) == sizeof( std::ostream& ) };
|
||||
};
|
||||
|
||||
template< typename T >
|
||||
struct is_serializable
|
||||
{
|
||||
static std::ostream& s();
|
||||
static const T& t();
|
||||
|
||||
typedef BOOST_DEDUCED_TYPENAME
|
||||
selector< sizeof( s() << t() ) >::type type;
|
||||
};
|
||||
struct is_serializable : public boost::integral_constant< bool, is_serializable_impl< T >::value >
|
||||
{};
|
||||
|
||||
template< typename T >
|
||||
std::string format( const T& t,
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@ namespace mock
|
|||
{
|
||||
namespace detail
|
||||
{
|
||||
typedef char true_type;
|
||||
struct false_type
|
||||
{
|
||||
char padding[8];
|
||||
};
|
||||
typedef char true_type;
|
||||
struct false_type
|
||||
{
|
||||
char padding[8];
|
||||
};
|
||||
|
||||
template< typename T >
|
||||
true_type& has_result_type_tester( T*, BOOST_DEDUCED_TYPENAME T::result_type* = 0 );
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
#include <boost/function_types/function_type.hpp>
|
||||
#include <boost/mpl/vector.hpp>
|
||||
#include <boost/mpl/erase.hpp>
|
||||
#include <boost/mpl/insert_range.hpp>
|
||||
#include <boost/mpl/copy.hpp>
|
||||
#include <boost/mpl/back_inserter.hpp>
|
||||
#define BOOST_TYPEOF_SILENT
|
||||
#include <boost/typeof/typeof.hpp>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue