From af381d82a0645fcdf55ea74a4bf948e637fa3e83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ion=20Gazta=C3=B1aga?= Date: Wed, 18 Jan 2023 23:50:11 +0100 Subject: [PATCH] Avoid dependency on boost::ignore_unused --- include/boost/container/detail/workaround.hpp | 8 ++++++++ include/boost/container/throw_exception.hpp | 9 ++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/include/boost/container/detail/workaround.hpp b/include/boost/container/detail/workaround.hpp index d1c4824..22a8ae0 100644 --- a/include/boost/container/detail/workaround.hpp +++ b/include/boost/container/detail/workaround.hpp @@ -152,6 +152,14 @@ //#define BOOST_CONTAINER_USE_STD_EXCEPTIONS +namespace boost { +namespace container { + +template +BOOST_FORCEINLINE BOOST_CXX14_CONSTEXPR void ignore(T1 const&) +{} + +}} //namespace boost::container { #endif //#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP diff --git a/include/boost/container/throw_exception.hpp b/include/boost/container/throw_exception.hpp index f80c905..a49f222 100644 --- a/include/boost/container/throw_exception.hpp +++ b/include/boost/container/throw_exception.hpp @@ -21,7 +21,6 @@ #include #include -#include #ifndef BOOST_NO_EXCEPTIONS #include //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(); }