Remove boost deprecations

Fixes:

boost/test/floating_point_comparison.hpp:14:124: note: #pragma message: This header is deprecated. Use This header is deprecated. Please use <boost/test/tools/floating_point_comparison.hpp> instead. instead.
boost/detail/sp_typeinfo.hpp:23:54: note: #pragma message: This header is deprecated. Use <boost/core/typeinfo.hpp> instead.
This commit is contained in:
Dirk Faust 2019-12-20 07:18:51 +01:00
parent 44e8509d6f
commit d140e31f6f
2 changed files with 20 additions and 4 deletions

View file

@ -19,7 +19,11 @@
#include <boost/type_traits/common_type.hpp>
#include <boost/type_traits/is_convertible.hpp>
#include <boost/type_traits/has_equal_to.hpp>
#if BOOST_VERSION >= 107000
#include <boost/test/tools/floating_point_comparison.hpp>
#else
#include <boost/test/floating_point_comparison.hpp>
#endif
namespace mock
{

View file

@ -14,7 +14,11 @@
#include <boost/algorithm/string/replace.hpp>
#include <boost/algorithm/string/erase.hpp>
#include <boost/algorithm/string/trim.hpp>
#if BOOST_VERSION >= 107000
#include <boost/core/typeinfo.hpp>
#else
#include <boost/detail/sp_typeinfo.hpp>
#endif
#include <boost/shared_ptr.hpp>
#include <stdexcept>
#include <typeinfo>
@ -24,7 +28,15 @@
#include <cstdlib>
#endif
#define MOCK_TYPE_NAME( t ) mock::detail::type_name( BOOST_SP_TYPEID(t) )
#if BOOST_VERSION >= 107000
#define MOCK_TYPE_ID( t ) BOOST_CORE_TYPEID(t)
#define TYPEINFO boost::core::typeinfo
#else
#define MOCK_TYPE_ID( t ) BOOST_SP_TYPEID(t)
#define TYPEINFO boost::detail::sp_typeinfo
#endif
#define MOCK_TYPE_NAME( t ) mock::detail::type_name( MOCK_TYPE_ID(t) )
namespace mock
{
@ -33,7 +45,7 @@ namespace detail
class type_name
{
public:
explicit type_name( const boost::detail::sp_typeinfo& info )
explicit type_name( const TYPEINFO& info )
: info_( &info )
{}
friend std::ostream& operator<<( std::ostream& s, const type_name& t )
@ -43,7 +55,7 @@ namespace detail
}
private:
void serialize( std::ostream& s,
const boost::detail::sp_typeinfo& info ) const
const TYPEINFO& info ) const
{
const char* name = info.name();
#ifdef __GNUC__
@ -108,7 +120,7 @@ namespace detail
return std::string::npos;
}
const boost::detail::sp_typeinfo* info_;
const TYPEINFO* info_;
};
}
} // mock