mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Added extra namespace level to protect from unwanted argument lookup
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@148 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
e390f502b5
commit
d3f7934e2d
1 changed files with 6 additions and 3 deletions
|
|
@ -22,6 +22,8 @@
|
||||||
namespace mock
|
namespace mock
|
||||||
{
|
{
|
||||||
namespace detail
|
namespace detail
|
||||||
|
{
|
||||||
|
namespace protect
|
||||||
{
|
{
|
||||||
struct eater
|
struct eater
|
||||||
{
|
{
|
||||||
|
|
@ -50,7 +52,7 @@ namespace detail
|
||||||
template< typename T >
|
template< typename T >
|
||||||
std::string serialize( const T& t,
|
std::string serialize( const T& t,
|
||||||
BOOST_DEDUCED_TYPENAME boost::enable_if<
|
BOOST_DEDUCED_TYPENAME boost::enable_if<
|
||||||
BOOST_DEDUCED_TYPENAME detail::is_serializable< T > >::type* = 0 )
|
BOOST_DEDUCED_TYPENAME is_serializable< T > >::type* = 0 )
|
||||||
{
|
{
|
||||||
std::stringstream s;
|
std::stringstream s;
|
||||||
static_cast< std::ostream& >( s ) << std::boolalpha << t;
|
static_cast< std::ostream& >( s ) << std::boolalpha << t;
|
||||||
|
|
@ -59,16 +61,17 @@ namespace detail
|
||||||
template< typename T >
|
template< typename T >
|
||||||
std::string serialize( const T&,
|
std::string serialize( const T&,
|
||||||
BOOST_DEDUCED_TYPENAME boost::disable_if<
|
BOOST_DEDUCED_TYPENAME boost::disable_if<
|
||||||
BOOST_DEDUCED_TYPENAME detail::is_serializable< T > >::type* = 0 )
|
BOOST_DEDUCED_TYPENAME is_serializable< T > >::type* = 0 )
|
||||||
{
|
{
|
||||||
return "?";
|
return "?";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
template< typename T >
|
template< typename T >
|
||||||
std::string format( const T& t )
|
std::string format( const T& t )
|
||||||
{
|
{
|
||||||
return detail::serialize( t );
|
return detail::protect::serialize( t );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline std::string format( const char* s )
|
inline std::string format( const char* s )
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue