mirror of
https://github.com/mat007/turtle.git
synced 2026-06-22 12:13:43 +00:00
Replaced std::type_info with boost::detail::sp_typeinfo
git-svn-id: https://svn.code.sf.net/p/turtle/code/trunk@553 860be788-9bd5-4423-9f1e-828f051e677b
This commit is contained in:
parent
8aa007af3b
commit
25ccf6078f
4 changed files with 11 additions and 9 deletions
|
|
@ -10,6 +10,7 @@
|
|||
#define MOCK_TYPE_NAME_HPP_INCLUDED
|
||||
|
||||
#include <boost/test/utils/basic_cstring/io.hpp>
|
||||
#include <boost/detail/sp_typeinfo.hpp>
|
||||
#include <stdexcept>
|
||||
#include <typeinfo>
|
||||
#include <ostream>
|
||||
|
|
@ -25,7 +26,7 @@ namespace detail
|
|||
class type_name
|
||||
{
|
||||
public:
|
||||
explicit type_name( const std::type_info& info )
|
||||
explicit type_name( const boost::detail::sp_typeinfo& info )
|
||||
: info_( &info )
|
||||
{}
|
||||
friend std::ostream& operator<<( std::ostream& s, const type_name& t )
|
||||
|
|
@ -34,7 +35,8 @@ namespace detail
|
|||
return s;
|
||||
}
|
||||
private:
|
||||
void serialize( std::ostream& s, const std::type_info& info ) const
|
||||
void serialize( std::ostream& s,
|
||||
const boost::detail::sp_typeinfo& info ) const
|
||||
{
|
||||
const char* name = info.name();
|
||||
#ifdef __GNUC__
|
||||
|
|
@ -76,7 +78,7 @@ namespace detail
|
|||
s << name;
|
||||
}
|
||||
|
||||
const std::type_info* info_;
|
||||
const boost::detail::sp_typeinfo* info_;
|
||||
};
|
||||
}
|
||||
} // mock
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
{ \
|
||||
mock::detail::configure( *this, t##_mock_, \
|
||||
instance.substr( 0, instance.rfind( BOOST_PP_STRINGIZE(t) ) ), \
|
||||
mock::detail::type_name( typeid( *this ) ), \
|
||||
mock::detail::type_name( BOOST_SP_TYPEID( *this ) ), \
|
||||
BOOST_PP_STRINGIZE(t) ); \
|
||||
return t##_mock_; \
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue