diff --git a/include/boost/fixed_string/detail/fixed_string.hpp b/include/boost/fixed_string/detail/fixed_string.hpp index f0dc2b2..3a0542e 100644 --- a/include/boost/fixed_string/detail/fixed_string.hpp +++ b/include/boost/fixed_string/detail/fixed_string.hpp @@ -126,7 +126,11 @@ CharT* raw_to_string(CharT* last, std::size_t size, Integer i) { boost::ignore_unused(size); +#ifdef BOOST_FIXED_STRING_USE_BOOST BOOST_ASSERT(size >= max_digits(sizeof(Integer))); +#else + assert(size >= max_digits(sizeof(Integer))); +#endif return raw_to_string( last, i, std::is_signed{}); } diff --git a/include/boost/fixed_string/fixed_string.hpp b/include/boost/fixed_string/fixed_string.hpp index d4f7eaa..fb3e988 100644 --- a/include/boost/fixed_string/fixed_string.hpp +++ b/include/boost/fixed_string/fixed_string.hpp @@ -916,7 +916,11 @@ public: void pop_back() { +#ifdef BOOST_FIXED_STRING_USE_BOOST BOOST_ASSERT(n_ > 0); +#else + assert(n > 0); +#endif Traits::assign(s_[--n_], 0); } diff --git a/include/boost/fixed_string/impl/fixed_string.hpp b/include/boost/fixed_string/impl/fixed_string.hpp index 2e56f59..15c7862 100644 --- a/include/boost/fixed_string/impl/fixed_string.hpp +++ b/include/boost/fixed_string/impl/fixed_string.hpp @@ -795,7 +795,11 @@ to_fixed_string(Integer x) { using CharT = char; using Traits = std::char_traits; +#ifdef BOOST_FIXED_STRING_USE_BOOST BOOST_STATIC_ASSERT(std::is_integral::value); +#else + static_assert(std::is_integral::value); +#endif char buf[detail::max_digits(sizeof(Integer))]; auto last = buf + sizeof(buf); auto it = detail::raw_to_string<