Added assert macros

This commit is contained in:
Krystian Stasiowski
2019-10-27 19:40:29 -04:00
parent 58ef0fb908
commit fca9d8e01f
4 changed files with 43 additions and 38 deletions

View File

@ -10,7 +10,7 @@
#ifndef BOOST_FIXED_STRING_DETAIL_FIXED_STRING_HPP
#define BOOST_FIXED_STRING_DETAIL_FIXED_STRING_HPP
#include <boost/assert.hpp>
#include <boost/fixed_string/config.hpp>
#include <boost/core/ignore_unused.hpp>
#include <iterator>
#include <type_traits>
@ -126,11 +126,7 @@ 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
BOOST_FIXED_STRING_ASSERT(size >= max_digits(sizeof(Integer)));
return raw_to_string<CharT, Integer, Traits>(
last, i, std::is_signed<Integer>{});
}