Avoid dependency on boost::ignore_unused

This commit is contained in:
Ion Gaztañaga
2023-01-18 23:50:11 +01:00
parent cfa3dda60e
commit af381d82a0
2 changed files with 12 additions and 5 deletions

View File

@@ -152,6 +152,14 @@
//#define BOOST_CONTAINER_USE_STD_EXCEPTIONS
namespace boost {
namespace container {
template <typename T1>
BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore(T1 const&)
{}
}} //namespace boost::container {
#endif //#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP

View File

@@ -21,7 +21,6 @@
#include <boost/container/detail/config_begin.hpp>
#include <boost/container/detail/workaround.hpp>
#include <boost/core/ignore_unused.hpp>
#ifndef BOOST_NO_EXCEPTIONS
#include <exception> //for std exception base
@@ -156,28 +155,28 @@ namespace container {
BOOST_NORETURN inline void throw_out_of_range(const char* str)
{
boost::ignore_unused(str);
boost::container::ignore(str);
BOOST_ASSERT_MSG(!"boost::container out_of_range thrown", str);
std::abort();
}
BOOST_NORETURN inline void throw_length_error(const char* str)
{
boost::ignore_unused(str);
boost::container::ignore(str);
BOOST_ASSERT_MSG(!"boost::container length_error thrown", str);
std::abort();
}
BOOST_NORETURN inline void throw_logic_error(const char* str)
{
boost::ignore_unused(str);
boost::container::ignore(str);
BOOST_ASSERT_MSG(!"boost::container logic_error thrown", str);
std::abort();
}
BOOST_NORETURN inline void throw_runtime_error(const char* str)
{
boost::ignore_unused(str);
boost::container::ignore(str);
BOOST_ASSERT_MSG(!"boost::container runtime_error thrown", str);
std::abort();
}