diff --git a/include/boost/container/throw_exception.hpp b/include/boost/container/throw_exception.hpp index 59eaba6..e2a0f6a 100644 --- a/include/boost/container/throw_exception.hpp +++ b/include/boost/container/throw_exception.hpp @@ -21,6 +21,7 @@ #include #include +#include #ifndef BOOST_NO_EXCEPTIONS #include //for std exception types @@ -51,41 +52,35 @@ namespace container { BOOST_NORETURN inline void throw_bad_alloc() { - const char msg[] = "boost::container bad_alloc thrown"; - (void)msg; - BOOST_ASSERT(!msg); + BOOST_ASSERT(!"boost::container bad_alloc thrown"); std::abort(); } BOOST_NORETURN inline void throw_out_of_range(const char* str) { - const char msg[] = "boost::container out_of_range thrown"; - (void)msg; (void)str; - BOOST_ASSERT_MSG(!msg, str); + boost::ignore_unused(str); + BOOST_ASSERT_MSG(!"boost::container out_of_range thrown", str); std::abort(); } BOOST_NORETURN inline void throw_length_error(const char* str) { - const char msg[] = "boost::container length_error thrown"; - (void)msg; (void)str; - BOOST_ASSERT_MSG(!msg, str); + boost::ignore_unused(str); + BOOST_ASSERT_MSG(!"boost::container length_error thrown", str); std::abort(); } BOOST_NORETURN inline void throw_logic_error(const char* str) { - const char msg[] = "boost::container logic_error thrown"; - (void)msg; (void)str; - BOOST_ASSERT_MSG(!msg, str); + boost::ignore_unused(str); + BOOST_ASSERT_MSG(!"boost::container logic_error thrown", str); std::abort(); } BOOST_NORETURN inline void throw_runtime_error(const char* str) { - const char msg[] = "boost::container runtime_error thrown"; - (void)msg; (void)str; - BOOST_ASSERT_MSG(!msg, str); + boost::ignore_unused(str); + BOOST_ASSERT_MSG(!"boost::container runtime_error thrown", str); std::abort(); }