const _Tp&
clamp(const _Tp& __v, const _Tp& __lo, const _Tp& __hi, _Compare __comp)
{
- _LIBCPP_ASSERT(!__comp(__hi, __lo), "Bad bounds passed to std::clamp");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__comp(__hi, __lo), "Bad bounds passed to std::clamp");
return __comp(__v, __lo) ? __lo : __comp(__hi, __v) ? __hi : __v;
}
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
void __pop_heap(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare& __comp,
typename iterator_traits<_RandomAccessIterator>::difference_type __len) {
- _LIBCPP_ASSERT(__len > 0, "The heap given to pop_heap must be non-empty");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__len > 0, "The heap given to pop_heap must be non-empty");
__comp_ref_type<_Compare> __comp_ref = __comp;
indirect_strict_weak_order<projected<const _Type*, _Proj>> _Comp = ranges::less>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr const _Type& operator()(
const _Type& __value, const _Type& __low, const _Type& __high, _Comp __comp = {}, _Proj __proj = {}) const {
- _LIBCPP_ASSERT(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))),
- "Bad bounds passed to std::ranges::clamp");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))),
+ "Bad bounds passed to std::ranges::clamp");
if (std::invoke(__comp, std::invoke(__proj, __value), std::invoke(__proj, __low)))
return __low;
indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp
operator()(initializer_list<_Tp> __il, _Comp __comp = {}, _Proj __proj = {}) const {
- _LIBCPP_ASSERT(__il.begin() != __il.end(), "initializer_list must contain at least one element");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__il.begin() != __il.end(), "initializer_list must contain at least one element");
auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
return *ranges::__min_element_impl(__il.begin(), __il.end(), __comp_lhs_rhs_swapped, __proj);
auto __first = ranges::begin(__r);
auto __last = ranges::end(__r);
- _LIBCPP_ASSERT(__first != __last, "range must contain at least one element");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first != __last, "range must contain at least one element");
if constexpr (forward_range<_Rp> && !__is_cheap_to_copy<range_value_t<_Rp>>) {
auto __comp_lhs_rhs_swapped = [&](auto&& __lhs, auto&& __rhs) { return std::invoke(__comp, __rhs, __lhs); };
indirect_strict_weak_order<projected<const _Tp*, _Proj>> _Comp = ranges::less>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Tp
operator()(initializer_list<_Tp> __il, _Comp __comp = {}, _Proj __proj = {}) const {
- _LIBCPP_ASSERT(__il.begin() != __il.end(), "initializer_list must contain at least one element");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__il.begin() != __il.end(), "initializer_list must contain at least one element");
return *ranges::__min_element_impl(__il.begin(), __il.end(), __comp, __proj);
}
operator()(_Rp&& __r, _Comp __comp = {}, _Proj __proj = {}) const {
auto __first = ranges::begin(__r);
auto __last = ranges::end(__r);
- _LIBCPP_ASSERT(__first != __last, "range must contain at least one element");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first != __last, "range must contain at least one element");
if constexpr (forward_range<_Rp> && !__is_cheap_to_copy<range_value_t<_Rp>>) {
return *ranges::__min_element_impl(__first, __last, __comp, __proj);
} else {
indirect_strict_weak_order<projected<const _Type*, _Proj>> _Comp = ranges::less>
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr ranges::minmax_result<_Type>
operator()(initializer_list<_Type> __il, _Comp __comp = {}, _Proj __proj = {}) const {
- _LIBCPP_ASSERT(__il.begin() != __il.end(), "initializer_list has to contain at least one element");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__il.begin() != __il.end(), "initializer_list has to contain at least one element");
auto __iters = std::__minmax_element_impl(__il.begin(), __il.end(), __comp, __proj);
return ranges::minmax_result<_Type>{*__iters.first, *__iters.second};
}
auto __last = ranges::end(__r);
using _ValueT = range_value_t<_Range>;
- _LIBCPP_ASSERT(__first != __last, "range has to contain at least one element");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first != __last, "range has to contain at least one element");
if constexpr (forward_range<_Range>) {
// Special-case the one element case. Avoid repeatedly initializing objects from the result of an iterator
_SampleIterator __sample(_PopulationIterator __first,
_PopulationSentinel __last, _SampleIterator __output_iter,
_Distance __n, _UniformRandomNumberGenerator& __g) {
- _LIBCPP_ASSERT(__n >= 0, "N must be a positive number.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n >= 0, "N must be a positive number.");
using _PopIterCategory = typename _IterOps<_AlgPolicy>::template __iterator_category<_PopulationIterator>;
using _Difference = typename _IterOps<_AlgPolicy>::template __difference_type<_PopulationIterator>;
typename iterator_traits<_RandomAccessIterator>::difference_type __len)
{
using difference_type = typename iterator_traits<_RandomAccessIterator>::difference_type;
- _LIBCPP_ASSERT(__len >= 2, "shouldn't be called unless __len >= 2");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__len >= 2, "shouldn't be called unless __len >= 2");
_RandomAccessIterator __hole = __first;
_RandomAccessIterator __child_i = __first;
do {
*__j = _Ops::__iter_move(__k);
__j = __k;
- _LIBCPP_ASSERT(__k != __leftmost, "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __k != __leftmost,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
} while (__comp(__t, *--__k)); // No need for bounds check due to the assumption stated above.
*__j = std::move(__t);
}
using _Ops = _IterOps<_AlgPolicy>;
typedef typename std::iterator_traits<_RandomAccessIterator>::value_type value_type;
typedef typename std::iterator_traits<_RandomAccessIterator>::difference_type difference_type;
- _LIBCPP_ASSERT(__last - __first >= difference_type(3), "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__last - __first >= difference_type(3), "");
const _RandomAccessIterator __begin = __first; // used for bounds checking, those are not moved around
const _RandomAccessIterator __end = __last; (void)__end; //
// Not guarded since we know the last element is greater than the pivot.
do {
++__first;
- _LIBCPP_ASSERT(__first != __end, "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __first != __end,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
} while (!__comp(__pivot, *__first));
} else {
while (++__first < __last && !__comp(__pivot, *__first)) {
// It will be always guarded because __introsort will do the median-of-three
// before calling this.
do {
- _LIBCPP_ASSERT(__last != __begin, "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __last != __begin,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
--__last;
} while (__comp(__pivot, *__last));
}
using _Ops = _IterOps<_AlgPolicy>;
typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type;
typedef typename std::iterator_traits<_RandomAccessIterator>::value_type value_type;
- _LIBCPP_ASSERT(__last - __first >= difference_type(3), "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__last - __first >= difference_type(3), "");
const _RandomAccessIterator __begin = __first; // used for bounds checking, those are not moved around
const _RandomAccessIterator __end = __last; (void)__end; //
value_type __pivot(_Ops::__iter_move(__first));
// this.
do {
++__first;
- _LIBCPP_ASSERT(__first != __end, "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __first != __end,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
} while (__comp(*__first, __pivot));
// Find the last element less than the pivot.
} else {
// Guarded.
do {
- _LIBCPP_ASSERT(__last != __begin, "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __last != __begin,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
--__last;
} while (!__comp(*__last, __pivot));
}
_Ops::iter_swap(__first, __last);
do {
++__first;
- _LIBCPP_ASSERT(__first != __end, "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __first != __end,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
} while (__comp(*__first, __pivot));
do {
- _LIBCPP_ASSERT(__last != __begin, "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __last != __begin,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
--__last;
} while (!__comp(*__last, __pivot));
}
// Guarded.
do {
++__first;
- _LIBCPP_ASSERT(__first != __end, "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __first != __end,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
} while (!__comp(__pivot, *__first));
} else {
while (++__first < __last && !__comp(__pivot, *__first)) {
// It will be always guarded because __introsort will do the
// median-of-three before calling this.
do {
- _LIBCPP_ASSERT(__last != __begin, "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __last != __begin,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
--__last;
} while (__comp(__pivot, *__last));
}
_Ops::iter_swap(__first, __last);
do {
++__first;
- _LIBCPP_ASSERT(__first != __end, "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __first != __end,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
} while (!__comp(__pivot, *__first));
do {
- _LIBCPP_ASSERT(__last != __begin, "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __last != __begin,
+ "Would read out of bounds, does your comparator satisfy the strict-weak ordering requirement?");
--__last;
} while (__comp(__pivot, *__last));
}
# define _LIBCPP_ASSERT(expression, message) ((void)0)
#endif
+#define _LIBCPP_ASSERT_UNCATEGORIZED(expression, message) _LIBCPP_ASSERT(expression, message)
+
#endif // _LIBCPP___ASSERT
if (__t < 2)
return 1;
const unsigned __n = numeric_limits<_Tp>::digits - std::countl_zero((_Tp)(__t - 1u));
- _LIBCPP_ASSERT(__n != numeric_limits<_Tp>::digits, "Bad input to bit_ceil");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n != numeric_limits<_Tp>::digits, "Bad input to bit_ceil");
if constexpr (sizeof(_Tp) >= sizeof(unsigned))
return _Tp{1} << __n;
template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI from_chars_result
from_chars(const char* __first, const char* __last, _Tp& __value, int __base) {
- _LIBCPP_ASSERT(2 <= __base && __base <= 36, "base not in [2, 36]");
+ _LIBCPP_ASSERT_UNCATEGORIZED(2 <= __base && __base <= 36, "base not in [2, 36]");
return std::__from_chars_integral(__first, __last, __value, __base);
}
#endif // _LIBCPP_STD_VER >= 17
/// range that can be used. However the range is sufficient for
/// \ref __base_10_u128.
_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline __uint128_t __pow_10(int __exp) noexcept {
- _LIBCPP_ASSERT(__exp >= __pow10_128_offset, "Index out of bounds");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__exp >= __pow10_128_offset, "Index out of bounds");
return __pow10_128[__exp - __pow10_128_offset];
}
_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI inline char*
__base_10_u128(char* __buffer, __uint128_t __value) noexcept {
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__value > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fail when this isn't true.");
// Unlike the 64 to 32 bit case the 128 bit case the "upper half" can't be
template <typename _Tp>
_LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __to_chars_integral_width(_Tp __value, unsigned __base) {
- _LIBCPP_ASSERT(__value >= 0, "The function requires a non-negative value.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__value >= 0, "The function requires a non-negative value.");
unsigned __base_2 = __base * __base;
unsigned __base_3 = __base_2 * __base;
template <typename _Tp, typename enable_if<is_integral<_Tp>::value, int>::type = 0>
inline _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI to_chars_result
to_chars(char* __first, char* __last, _Tp __value, int __base) {
- _LIBCPP_ASSERT(2 <= __base && __base <= 36, "base not in [2, 36]");
+ _LIBCPP_ASSERT_UNCATEGORIZED(2 <= __base && __base <= 36, "base not in [2, 36]");
using _Type = __make_32_64_or_128_bit_t<_Tp>;
return std::__to_chars_integral(__first, __last, static_cast<_Type>(__value), __base, is_signed<_Tp>());
/// zero is set to one. This means the first element of the lookup table is
/// zero.
static _LIBCPP_CONSTEXPR_SINCE_CXX23 _LIBCPP_HIDE_FROM_ABI int __width(_Tp __v) {
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__v > numeric_limits<uint64_t>::max(), "The optimizations for this algorithm fail when this isn't true.");
// There's always a bit set in the upper 64-bits.
auto __t = (128 - std::__libcpp_clz(static_cast<uint64_t>(__v >> 64))) * 1233 >> 12;
- _LIBCPP_ASSERT(__t >= __itoa::__pow10_128_offset, "Index out of bounds");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__t >= __itoa::__pow10_128_offset, "Index out of bounds");
// __t is adjusted since the lookup table misses the lower entries.
return __t - (__v < __itoa::__pow10_128[__t - __itoa::__pow10_128_offset]) + 1;
}
private:
_LIBCPP_HIDE_FROM_ABI constexpr _ConstIterator
__parse_chrono_specs(_ConstIterator __begin, _ConstIterator __end, __flags __flags) {
- _LIBCPP_ASSERT(__begin != __end,
- "When called with an empty input the function will cause "
- "undefined behavior by evaluating data not in the input");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __begin != __end,
+ "When called with an empty input the function will cause "
+ "undefined behavior by evaluating data not in the input");
if (*__begin != _CharT('%') && *__begin != _CharT('}'))
std::__throw_format_error("Expected '%' or '}' in the chrono format-string");
_LIBCPP_HIDE_FROM_ABI
bool done() const {
- _LIBCPP_ASSERT(__is_suspended(), "done() can be called only on suspended coroutines");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_suspended(), "done() can be called only on suspended coroutines");
return __builtin_coro_done(__handle_);
}
_LIBCPP_HIDE_FROM_ABI
void resume() const {
- _LIBCPP_ASSERT(__is_suspended(), "resume() can be called only on suspended coroutines");
- _LIBCPP_ASSERT(!done(), "resume() has undefined behavior when the coroutine is done");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_suspended(), "resume() can be called only on suspended coroutines");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!done(), "resume() has undefined behavior when the coroutine is done");
__builtin_coro_resume(__handle_);
}
_LIBCPP_HIDE_FROM_ABI
void destroy() const {
- _LIBCPP_ASSERT(__is_suspended(), "destroy() can be called only on suspended coroutines");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_suspended(), "destroy() can be called only on suspended coroutines");
__builtin_coro_destroy(__handle_);
}
_LIBCPP_HIDE_FROM_ABI
bool done() const {
- _LIBCPP_ASSERT(__is_suspended(), "done() can be called only on suspended coroutines");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_suspended(), "done() can be called only on suspended coroutines");
return __builtin_coro_done(__handle_);
}
_LIBCPP_HIDE_FROM_ABI
void resume() const {
- _LIBCPP_ASSERT(__is_suspended(), "resume() can be called only on suspended coroutines");
- _LIBCPP_ASSERT(!done(), "resume() has undefined behavior when the coroutine is done");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_suspended(), "resume() can be called only on suspended coroutines");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!done(), "resume() has undefined behavior when the coroutine is done");
__builtin_coro_resume(__handle_);
}
_LIBCPP_HIDE_FROM_ABI
void destroy() const {
- _LIBCPP_ASSERT(__is_suspended(), "destroy() can be called only on suspended coroutines");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__is_suspended(), "destroy() can be called only on suspended coroutines");
__builtin_coro_destroy(__handle_);
}
using _Comp_ref = __comp_ref_type<_Comp>;
if (!__libcpp_is_constant_evaluated()) {
// Check if the range is actually sorted.
- _LIBCPP_ASSERT((std::is_sorted<_RandomAccessIterator, _Comp_ref>(__first, __last, _Comp_ref(__comp))),
- "The range is not sorted after the sort, your comparator is not a valid strict-weak ordering");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ (std::is_sorted<_RandomAccessIterator, _Comp_ref>(__first, __last, _Comp_ref(__comp))),
+ "The range is not sorted after the sort, your comparator is not a valid strict-weak ordering");
// Limit the number of elements we need to check.
__diff_t __size = __last - __first > __diff_t(100) ? __diff_t(100) : __last - __first;
__diff_t __p = 0;
// Check that the elements from __p to __q are equal between each other.
for (__diff_t __b = __p; __b < __q; ++__b) {
for (__diff_t __a = __p; __a <= __b; ++__a) {
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
!__comp(*(__first + __a), *(__first + __b)), "Your comparator is not a valid strict-weak ordering");
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
!__comp(*(__first + __b), *(__first + __a)), "Your comparator is not a valid strict-weak ordering");
}
}
// Check that elements between __p and __q are less than between __q and __size.
for (__diff_t __a = __p; __a < __q; ++__a) {
for (__diff_t __b = __q; __b < __size; ++__b) {
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__comp(*(__first + __a), *(__first + __b)), "Your comparator is not a valid strict-weak ordering");
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
!__comp(*(__first + __b), *(__first + __a)), "Your comparator is not a valid strict-weak ordering");
}
}
// [expected.object.obs], observers
_LIBCPP_HIDE_FROM_ABI constexpr const _Tp* operator->() const noexcept {
- _LIBCPP_ASSERT(__has_val_, "expected::operator-> requires the expected to contain a value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__has_val_, "expected::operator-> requires the expected to contain a value");
return std::addressof(__union_.__val_);
}
_LIBCPP_HIDE_FROM_ABI constexpr _Tp* operator->() noexcept {
- _LIBCPP_ASSERT(__has_val_, "expected::operator-> requires the expected to contain a value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__has_val_, "expected::operator-> requires the expected to contain a value");
return std::addressof(__union_.__val_);
}
_LIBCPP_HIDE_FROM_ABI constexpr const _Tp& operator*() const& noexcept {
- _LIBCPP_ASSERT(__has_val_, "expected::operator* requires the expected to contain a value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__has_val_, "expected::operator* requires the expected to contain a value");
return __union_.__val_;
}
_LIBCPP_HIDE_FROM_ABI constexpr _Tp& operator*() & noexcept {
- _LIBCPP_ASSERT(__has_val_, "expected::operator* requires the expected to contain a value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__has_val_, "expected::operator* requires the expected to contain a value");
return __union_.__val_;
}
_LIBCPP_HIDE_FROM_ABI constexpr const _Tp&& operator*() const&& noexcept {
- _LIBCPP_ASSERT(__has_val_, "expected::operator* requires the expected to contain a value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__has_val_, "expected::operator* requires the expected to contain a value");
return std::move(__union_.__val_);
}
_LIBCPP_HIDE_FROM_ABI constexpr _Tp&& operator*() && noexcept {
- _LIBCPP_ASSERT(__has_val_, "expected::operator* requires the expected to contain a value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__has_val_, "expected::operator* requires the expected to contain a value");
return std::move(__union_.__val_);
}
}
_LIBCPP_HIDE_FROM_ABI constexpr const _Err& error() const& noexcept {
- _LIBCPP_ASSERT(!__has_val_, "expected::error requires the expected to contain an error");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__has_val_, "expected::error requires the expected to contain an error");
return __union_.__unex_;
}
_LIBCPP_HIDE_FROM_ABI constexpr _Err& error() & noexcept {
- _LIBCPP_ASSERT(!__has_val_, "expected::error requires the expected to contain an error");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__has_val_, "expected::error requires the expected to contain an error");
return __union_.__unex_;
}
_LIBCPP_HIDE_FROM_ABI constexpr const _Err&& error() const&& noexcept {
- _LIBCPP_ASSERT(!__has_val_, "expected::error requires the expected to contain an error");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__has_val_, "expected::error requires the expected to contain an error");
return std::move(__union_.__unex_);
}
_LIBCPP_HIDE_FROM_ABI constexpr _Err&& error() && noexcept {
- _LIBCPP_ASSERT(!__has_val_, "expected::error requires the expected to contain an error");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__has_val_, "expected::error requires the expected to contain an error");
return std::move(__union_.__unex_);
}
_LIBCPP_HIDE_FROM_ABI constexpr bool has_value() const noexcept { return __has_val_; }
_LIBCPP_HIDE_FROM_ABI constexpr void operator*() const noexcept {
- _LIBCPP_ASSERT(__has_val_, "expected::operator* requires the expected to contain a value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__has_val_, "expected::operator* requires the expected to contain a value");
}
_LIBCPP_HIDE_FROM_ABI constexpr void value() const& {
}
_LIBCPP_HIDE_FROM_ABI constexpr const _Err& error() const& noexcept {
- _LIBCPP_ASSERT(!__has_val_, "expected::error requires the expected to contain an error");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__has_val_, "expected::error requires the expected to contain an error");
return __union_.__unex_;
}
_LIBCPP_HIDE_FROM_ABI constexpr _Err& error() & noexcept {
- _LIBCPP_ASSERT(!__has_val_, "expected::error requires the expected to contain an error");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__has_val_, "expected::error requires the expected to contain an error");
return __union_.__unex_;
}
_LIBCPP_HIDE_FROM_ABI constexpr const _Err&& error() const&& noexcept {
- _LIBCPP_ASSERT(!__has_val_, "expected::error requires the expected to contain an error");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__has_val_, "expected::error requires the expected to contain an error");
return std::move(__union_.__unex_);
}
_LIBCPP_HIDE_FROM_ABI constexpr _Err&& error() && noexcept {
- _LIBCPP_ASSERT(!__has_val_, "expected::error requires the expected to contain an error");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__has_val_, "expected::error requires the expected to contain an error");
return std::move(__union_.__unex_);
}
_LIBCPP_HIDE_FROM_ABI
const directory_entry& operator*() const {
- _LIBCPP_ASSERT(__imp_, "The end iterator cannot be dereferenced");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__imp_, "The end iterator cannot be dereferenced");
return __dereference();
}
_LIBCPP_INLINE_VISIBILITY
iterator& operator++() {
- _LIBCPP_ASSERT(__state_ != _Singular,
- "attempting to increment a singular iterator");
- _LIBCPP_ASSERT(__state_ != _AtEnd,
- "attempting to increment the end iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__state_ != _Singular,
+ "attempting to increment a singular iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__state_ != _AtEnd,
+ "attempting to increment the end iterator");
return __increment();
}
_LIBCPP_INLINE_VISIBILITY
iterator& operator--() {
- _LIBCPP_ASSERT(__state_ != _Singular,
- "attempting to decrement a singular iterator");
- _LIBCPP_ASSERT(__entry_.data() != __path_ptr_->native().data(),
- "attempting to decrement the begin iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__state_ != _Singular,
+ "attempting to decrement a singular iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__entry_.data() != __path_ptr_->native().data(),
+ "attempting to decrement the begin iterator");
return __decrement();
}
// The output doesn't fit in the internal buffer.
// Copy the data in "__capacity_" sized chunks.
- _LIBCPP_ASSERT(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
const _InCharT* __first = __str.data();
do {
size_t __chunk = _VSTD::min(__n, __capacity_);
/// Like @ref __copy it may need to do type conversion.
template <__fmt_char_type _InCharT, class _UnaryOperation>
_LIBCPP_HIDE_FROM_ABI void __transform(const _InCharT* __first, const _InCharT* __last, _UnaryOperation __operation) {
- _LIBCPP_ASSERT(__first <= __last, "not a valid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "not a valid range");
size_t __n = static_cast<size_t>(__last - __first);
__flush_on_overflow(__n);
// The output doesn't fit in the internal buffer.
// Transform the data in "__capacity_" sized chunks.
- _LIBCPP_ASSERT(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
do {
size_t __chunk = _VSTD::min(__n, __capacity_);
_VSTD::transform(__first, __first + __chunk, _VSTD::addressof(__ptr_[__size_]), __operation);
// The output doesn't fit in the internal buffer.
// Fill the buffer in "__capacity_" sized chunks.
- _LIBCPP_ASSERT(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__size_ == 0, "the buffer should be flushed by __flush_on_overflow");
do {
size_t __chunk = _VSTD::min(__n, __capacity_);
_VSTD::fill_n(_VSTD::addressof(__ptr_[__size_]), __chunk, __value);
template <__fmt_char_type _InCharT, class _UnaryOperation>
_LIBCPP_HIDE_FROM_ABI void __transform(const _InCharT* __first, const _InCharT* __last, _UnaryOperation __operation) {
- _LIBCPP_ASSERT(__first <= __last, "not a valid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "not a valid range");
size_t __n = static_cast<size_t>(__last - __first);
if (__size_ + __n >= __capacity_)
_LIBCPP_HIDE_FROM_ABI void __grow_buffer() { __grow_buffer(__capacity_ * 1.6); }
_LIBCPP_HIDE_FROM_ABI void __grow_buffer(size_t __capacity) {
- _LIBCPP_ASSERT(__capacity > __capacity_, "the buffer must grow");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__capacity > __capacity_, "the buffer must grow");
auto __result = std::__allocate_at_least(__alloc_, __capacity);
auto __guard = std::__make_exception_guard([&] {
allocator_traits<_Alloc>::deallocate(__alloc_, __result.ptr, __result.count);
_LIBCPP_HIDE_FROM_ABI
constexpr __arg_t __get_packed_type(uint64_t __types, size_t __id) {
- _LIBCPP_ASSERT(__id <= __packed_types_max, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__id <= __packed_types_max, "");
if (__id > 0)
__types >>= __id * __packed_arg_t_bits;
_LIBCPP_HIDE_FROM_ABI constexpr __parse_number_result<_Iterator>
__parse_automatic(_Iterator __begin, _Iterator, auto& __parse_ctx) {
size_t __value = __parse_ctx.next_arg_id();
- _LIBCPP_ASSERT(__value <= __number_max,
- "Compilers don't support this number of arguments");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __value <= __number_max,
+ "Compilers don't support this number of arguments");
return {__begin, uint32_t(__value)};
}
static_cast<unsigned>(__value), __ctx, __parser_.__get_parsed_std_specifications(__ctx));
default:
- _LIBCPP_ASSERT(false, "The parse function should have validated the type");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "The parse function should have validated the type");
__libcpp_unreachable();
}
}
template <floating_point _Tp>
_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value) {
to_chars_result __r = _VSTD::to_chars(__first, __last, __value);
- _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
return __r.ptr;
}
template <floating_point _Tp>
_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, chars_format __fmt) {
to_chars_result __r = _VSTD::to_chars(__first, __last, __value, __fmt);
- _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
return __r.ptr;
}
template <floating_point _Tp>
_LIBCPP_HIDE_FROM_ABI char* __to_buffer(char* __first, char* __last, _Tp __value, chars_format __fmt, int __precision) {
to_chars_result __r = _VSTD::to_chars(__first, __last, __value, __fmt, __precision);
- _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
return __r.ptr;
}
__result.__radix_point = __result.__last;
// clang-format off
- _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
- (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
- (__result.__exponent == __result.__last || *__result.__exponent == 'e'),
- "Post-condition failure.");
+ _LIBCPP_ASSERT_UNCATEGORIZED((__result.__integral != __result.__last) &&
+ (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
+ (__result.__exponent == __result.__last || *__result.__exponent == 'e'),
+ "Post-condition failure.");
// clang-format on
return __result;
}
// clang-format off
- _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
- (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
- (__result.__exponent != __result.__last && *__result.__exponent == 'p'),
- "Post-condition failure.");
+ _LIBCPP_ASSERT_UNCATEGORIZED((__result.__integral != __result.__last) &&
+ (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
+ (__result.__exponent != __result.__last && *__result.__exponent == 'p'),
+ "Post-condition failure.");
// clang-format on
return __result;
__formatter::__to_buffer(__integral, __buffer.end(), __value, chars_format::scientific, __precision);
char* __first = __integral + 1;
- _LIBCPP_ASSERT(__first != __result.__last, "No exponent present");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first != __result.__last, "No exponent present");
if (*__first == '.') {
__result.__radix_point = __first;
__result.__exponent = __formatter::__find_exponent(__first + 1, __result.__last);
}
// clang-format off
- _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
- (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
- (__result.__exponent != __result.__last && *__result.__exponent == 'e'),
- "Post-condition failure.");
+ _LIBCPP_ASSERT_UNCATEGORIZED((__result.__integral != __result.__last) &&
+ (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
+ (__result.__exponent != __result.__last && *__result.__exponent == 'e'),
+ "Post-condition failure.");
// clang-format on
return __result;
}
__result.__exponent = __result.__last;
// clang-format off
- _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
- (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
- (__result.__exponent == __result.__last),
- "Post-condition failure.");
+ _LIBCPP_ASSERT_UNCATEGORIZED((__result.__integral != __result.__last) &&
+ (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
+ (__result.__exponent == __result.__last),
+ "Post-condition failure.");
// clang-format on
return __result;
}
}
// clang-format off
- _LIBCPP_ASSERT((__result.__integral != __result.__last) &&
- (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
- (__result.__exponent == __result.__last || *__result.__exponent == 'e'),
- "Post-condition failure.");
+ _LIBCPP_ASSERT_UNCATEGORIZED((__result.__integral != __result.__last) &&
+ (__result.__radix_point == __result.__last || *__result.__radix_point == '.') &&
+ (__result.__exponent == __result.__last || *__result.__exponent == 'e'),
+ "Post-condition failure.");
// clang-format on
return __result;
return __formatter::__format_buffer_general_upper_case(__buffer, __value, __buffer.__precision(), __first);
default:
- _LIBCPP_ASSERT(false, "The parser should have validated the type");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "The parser should have validated the type");
__libcpp_unreachable();
}
}
* regardless whether the @c std::numpunct's type is @c char or @c wchar_t.
*/
_LIBCPP_HIDE_FROM_ABI inline string __determine_grouping(ptrdiff_t __size, const string& __grouping) {
- _LIBCPP_ASSERT(!__grouping.empty() && __size > __grouping[0],
- "The slow grouping formatting is used while there will be no "
- "separators written");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__grouping.empty() && __size > __grouping[0],
+ "The slow grouping formatting is used while there will be no "
+ "separators written");
string __r;
auto __end = __grouping.end() - 1;
auto __ptr = __grouping.begin();
// TODO FMT Evaluate code overhead due to not calling the internal function
// directly. (Should be zero overhead.)
to_chars_result __r = _VSTD::to_chars(__first, __last, __value, __base);
- _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
return __r.ptr;
}
return __formatter::__format_integer(__value, __ctx, __specs, __negative, __array.begin(), __array.end(), "0X", 16);
}
default:
- _LIBCPP_ASSERT(false, "The parse function should have validated the type");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "The parse function should have validated the type");
__libcpp_unreachable();
}
}
_LIBCPP_HIDE_FROM_ABI constexpr __padding_size_result
__padding_size(size_t __size, size_t __width, __format_spec::__alignment __align) {
- _LIBCPP_ASSERT(__width > __size, "don't call this function when no padding is required");
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(__width > __size, "don't call this function when no padding is required");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__align != __format_spec::__alignment::__zero_padding, "the caller should have handled the zero-padding");
size_t __fill = __width - __size;
auto __r = __grouping.rbegin();
auto __e = __grouping.rend() - 1;
- _LIBCPP_ASSERT(__r != __e, "The slow grouping formatting is used while "
- "there will be no separators written.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__r != __e, "The slow grouping formatting is used while "
+ "there will be no separators written.");
// The output is divided in small groups of numbers to write:
// - A group before the first separator.
// - A separator and a group, repeated for the number of separators.
output_iterator<const iter_value_t<_Iterator>&> auto __out_it,
__format_spec::__parsed_specifications<_ParserCharT> __specs,
ptrdiff_t __size) -> decltype(__out_it) {
- _LIBCPP_ASSERT(__first <= __last, "Not a valid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "Not a valid range");
return __formatter::__write(basic_string_view{__first, __last}, _VSTD::move(__out_it), __specs, __size);
}
_Iterator __last,
output_iterator<const iter_value_t<_Iterator>&> auto __out_it,
__format_spec::__parsed_specifications<_ParserCharT> __specs) -> decltype(__out_it) {
- _LIBCPP_ASSERT(__first <= __last, "Not a valid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "Not a valid range");
return __formatter::__write(__first, __last, _VSTD::move(__out_it), __specs, __last - __first);
}
output_iterator<const _CharT&> auto __out_it,
__format_spec::__parsed_specifications<_ParserCharT> __specs,
_UnaryOperation __op) -> decltype(__out_it) {
- _LIBCPP_ASSERT(__first <= __last, "Not a valid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "Not a valid range");
ptrdiff_t __size = __last - __first;
if (__size >= __specs.__width_)
size_t __size,
const _CharT* __exponent,
size_t __num_trailing_zeros) -> decltype(__out_it) {
- _LIBCPP_ASSERT(__first <= __last, "Not a valid range");
- _LIBCPP_ASSERT(__num_trailing_zeros > 0, "The overload not writing trailing zeros should have been used");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "Not a valid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__num_trailing_zeros > 0,
+ "The overload not writing trailing zeros should have been used");
__padding_size_result __padding =
__formatter::__padding_size(__size + __num_trailing_zeros, __specs.__width_, __specs.__alignment_);
basic_string_view<_CharT> __str,
output_iterator<const _CharT&> auto __out_it,
__format_spec::__parsed_specifications<_CharT> __specs) -> decltype(__out_it) {
- _LIBCPP_ASSERT(!__specs.__has_precision(), "use __write_string");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__specs.__has_precision(), "use __write_string");
// No padding -> copy the string
if (!__specs.__has_width())
char __buffer[8];
to_chars_result __r = std::to_chars(std::begin(__buffer), std::end(__buffer), __value, 16);
- _LIBCPP_ASSERT(__r.ec == errc(0), "Internal buffer too small");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__r.ec == errc(0), "Internal buffer too small");
std::ranges::copy(std::begin(__buffer), __r.ptr, __out_it);
__str += _CharT('}');
template <class _FormatContext>
_LIBCPP_HIDE_FROM_ABI typename _FormatContext::iterator format(const _CharT* __str, _FormatContext& __ctx) const {
- _LIBCPP_ASSERT(__str, "The basic_format_arg constructor should have "
- "prevented an invalid pointer.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__str, "The basic_format_arg constructor should have "
+ "prevented an invalid pointer.");
__format_spec::__parsed_specifications<_CharT> __specs = _Base::__parser_.__get_parsed_std_specifications(__ctx);
# if _LIBCPP_STD_VER >= 23
|| (same_as<_CharT, wchar_t> && sizeof(wchar_t) == 2)
# endif
_LIBCPP_HIDE_FROM_ABI constexpr bool __parse_fill_align(_Iterator& __begin, _Iterator __end, bool __use_range_fill) {
- _LIBCPP_ASSERT(__begin != __end,
- "when called with an empty input the function will cause "
- "undefined behavior by evaluating data not in the input");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__begin != __end,
+ "when called with an empty input the function will cause "
+ "undefined behavior by evaluating data not in the input");
__unicode::__code_point_view<_CharT> __view{__begin, __end};
__unicode::__consume_result __consumed = __view.__consume();
if (__consumed.__status != __unicode::__consume_result::__ok)
template <contiguous_iterator _Iterator>
requires(same_as<_CharT, wchar_t> && sizeof(wchar_t) == 4)
_LIBCPP_HIDE_FROM_ABI constexpr bool __parse_fill_align(_Iterator& __begin, _Iterator __end, bool __use_range_fill) {
- _LIBCPP_ASSERT(__begin != __end,
- "when called with an empty input the function will cause "
- "undefined behavior by evaluating data not in the input");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__begin != __end,
+ "when called with an empty input the function will cause "
+ "undefined behavior by evaluating data not in the input");
if (__begin + 1 != __end && __parse_alignment(*(__begin + 1))) {
if (!__unicode::__is_scalar_value(*__begin))
std::__throw_format_error("The fill character contains an invalid value");
// range-fill and tuple-fill are identical
template <contiguous_iterator _Iterator>
_LIBCPP_HIDE_FROM_ABI constexpr bool __parse_fill_align(_Iterator& __begin, _Iterator __end, bool __use_range_fill) {
- _LIBCPP_ASSERT(__begin != __end,
- "when called with an empty input the function will cause "
- "undefined behavior by evaluating data not in the input");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__begin != __end,
+ "when called with an empty input the function will cause "
+ "undefined behavior by evaluating data not in the input");
if (__begin + 1 != __end) {
if (__parse_alignment(*(__begin + 1))) {
__validate_fill_character(*__begin, __use_range_fill);
__format::__parse_number_result __r = __format::__parse_number(__begin, __end);
__width_ = __r.__value;
- _LIBCPP_ASSERT(__width_ != 0, "A zero value isn't allowed and should be impossible, "
- "due to validations in this function");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__width_ != 0, "A zero value isn't allowed and should be impossible, "
+ "due to validations in this function");
__begin = __r.__last;
return true;
}
__parse_empty_range_underlying_spec(_ParseContext& __ctx, typename _ParseContext::iterator __begin) {
__ctx.advance_to(__begin);
[[maybe_unused]] typename _ParseContext::iterator __result = __underlying_.parse(__ctx);
- _LIBCPP_ASSERT(__result == __begin,
- "the underlying's parse function should not advance the input beyond the end of the input");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __result == __begin,
+ "the underlying's parse function should not advance the input beyond the end of the input");
return __begin;
}
// - The parser always needs to consume these code units
// - The code is optimized for well-formed UTF-8
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __consume_result __consume() noexcept {
- _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first_ != __last_, "can't move beyond the end of input");
// Based on the number of leading 1 bits the number of code units in the
// code point can be determined. See
_LIBCPP_HIDE_FROM_ABI constexpr bool __at_end() const noexcept { return __first_ == __last_; }
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __consume_result __consume() noexcept {
- _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first_ != __last_, "can't move beyond the end of input");
char32_t __value = static_cast<char32_t>(*__first_++);
if constexpr (sizeof(wchar_t) == 2) {
// *** Break at the start and end of text, unless the text is empty. ***
- _LIBCPP_ASSERT(__prev != __property::__sot, "should be handled in the constructor"); // GB1
- _LIBCPP_ASSERT(__prev != __property::__eot, "should be handled by our caller"); // GB2
+ _LIBCPP_ASSERT_UNCATEGORIZED(__prev != __property::__sot, "should be handled in the constructor"); // GB1
+ _LIBCPP_ASSERT_UNCATEGORIZED(__prev != __property::__eot, "should be handled by our caller"); // GB2
// *** Do not break between a CR and LF. Otherwise, break before and after controls. ***
if (__prev == __property::__CR && __next == __property::__LF) // GB3
};
_LIBCPP_HIDE_FROM_ABI constexpr __cluster __consume() {
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__next_prop_ != __extended_grapheme_custer_property_boundary::__property::__eot,
"can't move beyond the end of input");
_LIBCPP_HIDE_FROM_ABI constexpr _Iterator __position() const noexcept { return __first_; }
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI constexpr __consume_result __consume() noexcept {
- _LIBCPP_ASSERT(__first_ != __last_, "can't move beyond the end of input");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first_ != __last_, "can't move beyond the end of input");
return {static_cast<char32_t>(*__first_++)};
}
{ }
virtual __base<_Rp(_ArgTypes...)>* __clone() const {
- _LIBCPP_ASSERT(false,
+ _LIBCPP_ASSERT_UNCATEGORIZED(false,
"Block pointers are just pointers, so they should always fit into "
"std::function's small buffer optimization. This function should "
"never be invoked.");
}
virtual void destroy_deallocate() _NOEXCEPT {
- _LIBCPP_ASSERT(false,
+ _LIBCPP_ASSERT_UNCATEGORIZED(false,
"Block pointers are just pointers, so they should always fit into "
"std::function's small buffer optimization. This function should "
"never be invoked.");
_LIBCPP_INLINE_VISIBILITY
size_type bucket(const _Key& __k) const
{
- _LIBCPP_ASSERT(bucket_count() > 0,
+ _LIBCPP_ASSERT_UNCATEGORIZED(bucket_count() > 0,
"unordered container::bucket(key) called when bucket_count() == 0");
return std::__constrain_hash(hash_function()(__k), bucket_count());
}
}
_LIBCPP_INLINE_VISIBILITY void max_load_factor(float __mlf) _NOEXCEPT
{
- _LIBCPP_ASSERT(__mlf > 0,
+ _LIBCPP_ASSERT_UNCATEGORIZED(__mlf > 0,
"unordered container::max_load_factor(lf) called with lf <= 0");
max_load_factor() = _VSTD::max(__mlf, load_factor());
}
local_iterator
begin(size_type __n)
{
- _LIBCPP_ASSERT(__n < bucket_count(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n < bucket_count(),
"unordered container::begin(n) called with n >= bucket_count()");
return local_iterator(__bucket_list_[__n], __n, bucket_count(), this);
}
local_iterator
end(size_type __n)
{
- _LIBCPP_ASSERT(__n < bucket_count(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n < bucket_count(),
"unordered container::end(n) called with n >= bucket_count()");
return local_iterator(nullptr, __n, bucket_count(), this);
}
const_local_iterator
cbegin(size_type __n) const
{
- _LIBCPP_ASSERT(__n < bucket_count(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n < bucket_count(),
"unordered container::cbegin(n) called with n >= bucket_count()");
return const_local_iterator(__bucket_list_[__n], __n, bucket_count(), this);
}
const_local_iterator
cend(size_type __n) const
{
- _LIBCPP_ASSERT(__n < bucket_count(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n < bucket_count(),
"unordered container::cend(n) called with n >= bucket_count()");
return const_local_iterator(nullptr, __n, bucket_count(), this);
}
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
"unordered container erase(iterator) called with an iterator not"
" referring to this container");
- _LIBCPP_ASSERT(__p != end(),
- "unordered container erase(iterator) called with a non-dereferenceable iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__p != end(),
+ "unordered container erase(iterator) called with a non-dereferenceable iterator");
iterator __r(__np, this);
++__r;
remove(__p);
_NOEXCEPT_(__is_nothrow_swappable<hasher>::value && __is_nothrow_swappable<key_equal>::value)
#endif
{
- _LIBCPP_ASSERT(__node_traits::propagate_on_container_swap::value ||
- this->__node_alloc() == __u.__node_alloc(),
- "list::swap: Either propagate_on_container_swap must be true"
- " or the allocators must compare equal");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__node_traits::propagate_on_container_swap::value ||
+ this->__node_alloc() == __u.__node_alloc(),
+ "list::swap: Either propagate_on_container_swap must be true"
+ " or the allocators must compare equal");
{
__node_pointer_pointer __npp = __bucket_list_.release();
__bucket_list_.reset(__u.__bucket_list_.release());
typename __hash_table<_Tp, _Hash, _Equal, _Alloc>::size_type
__hash_table<_Tp, _Hash, _Equal, _Alloc>::bucket_size(size_type __n) const
{
- _LIBCPP_ASSERT(__n < bucket_count(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n < bucket_count(),
"unordered container::bucket_size(n) called with n >= bucket_count()");
__next_pointer __np = __bucket_list_[__n];
size_type __bc = bucket_count();
void advance(_InputIter& __i, _Distance __orig_n) {
typedef typename iterator_traits<_InputIter>::difference_type _Difference;
_Difference __n = static_cast<_Difference>(_VSTD::__convert_to_integral(__orig_n));
- _LIBCPP_ASSERT(__n >= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
- "Attempt to advance(it, n) with negative n on a non-bidirectional iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n >= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
+ "Attempt to advance(it, n) with negative n on a non-bidirectional iterator");
_VSTD::__advance(__i, __n, typename iterator_traits<_InputIter>::iterator_category());
}
template <input_or_output_iterator _Ip>
_LIBCPP_HIDE_FROM_ABI
constexpr void operator()(_Ip& __i, iter_difference_t<_Ip> __n) const {
- _LIBCPP_ASSERT(__n >= 0 || bidirectional_iterator<_Ip>,
- "If `n < 0`, then `bidirectional_iterator<I>` must be true.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n >= 0 || bidirectional_iterator<_Ip>,
+ "If `n < 0`, then `bidirectional_iterator<I>` must be true.");
// If `I` models `random_access_iterator`, equivalent to `i += n`.
if constexpr (random_access_iterator<_Ip>) {
template <input_or_output_iterator _Ip, sentinel_for<_Ip> _Sp>
_LIBCPP_HIDE_FROM_ABI constexpr iter_difference_t<_Ip> operator()(_Ip& __i, iter_difference_t<_Ip> __n,
_Sp __bound_sentinel) const {
- _LIBCPP_ASSERT((__n >= 0) || (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>),
- "If `n < 0`, then `bidirectional_iterator<I> && same_as<I, S>` must be true.");
+ _LIBCPP_ASSERT_UNCATEGORIZED((__n >= 0) || (bidirectional_iterator<_Ip> && same_as<_Ip, _Sp>),
+ "If `n < 0`, then `bidirectional_iterator<I> && same_as<I, S>` must be true.");
// If `S` and `I` model `sized_sentinel_for<S, I>`:
if constexpr (sized_sentinel_for<_Sp, _Ip>) {
// If |n| >= |bound_sentinel - i|, equivalent to `ranges::advance(i, bound_sentinel)`.
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit __bounded_iter(
_Iterator __current, _Iterator __begin, _Iterator __end)
: __current_(__current), __begin_(__begin), __end_(__end) {
- _LIBCPP_ASSERT(__begin <= __end, "__bounded_iter(current, begin, end): [begin, end) is not a valid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __begin <= __end, "__bounded_iter(current, begin, end): [begin, end) is not a valid range");
}
template <class _It>
//
// These operations check that the iterator is dereferenceable, that is within [begin, end).
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator*() const _NOEXCEPT {
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__in_bounds(__current_), "__bounded_iter::operator*: Attempt to dereference an out-of-range iterator");
return *__current_;
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pointer operator->() const _NOEXCEPT {
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__in_bounds(__current_), "__bounded_iter::operator->: Attempt to dereference an out-of-range iterator");
return std::__to_address(__current_);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 reference operator[](difference_type __n) const _NOEXCEPT {
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__in_bounds(__current_ + __n), "__bounded_iter::operator[]: Attempt to index an iterator out-of-range");
return __current_[__n];
}
requires convertible_to<const _I2&, _Iter> && convertible_to<const _S2&, _Sent>
_LIBCPP_HIDE_FROM_ABI constexpr common_iterator(const common_iterator<_I2, _S2>& __other)
: __hold_([&]() -> variant<_Iter, _Sent> {
- _LIBCPP_ASSERT(!__other.__hold_.valueless_by_exception(), "Attempted to construct from a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__other.__hold_.valueless_by_exception(),
+ "Attempted to construct from a valueless common_iterator");
if (__other.__hold_.index() == 0)
return variant<_Iter, _Sent>{in_place_index<0>, _VSTD::__unchecked_get<0>(__other.__hold_)};
return variant<_Iter, _Sent>{in_place_index<1>, _VSTD::__unchecked_get<1>(__other.__hold_)};
requires convertible_to<const _I2&, _Iter> && convertible_to<const _S2&, _Sent> &&
assignable_from<_Iter&, const _I2&> && assignable_from<_Sent&, const _S2&>
_LIBCPP_HIDE_FROM_ABI common_iterator& operator=(const common_iterator<_I2, _S2>& __other) {
- _LIBCPP_ASSERT(!__other.__hold_.valueless_by_exception(), "Attempted to assign from a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__other.__hold_.valueless_by_exception(),
+ "Attempted to assign from a valueless common_iterator");
auto __idx = __hold_.index();
auto __other_idx = __other.__hold_.index();
_LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*()
{
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__hold_),
+ "Attempted to dereference a non-dereferenceable common_iterator");
return *_VSTD::__unchecked_get<_Iter>(__hold_);
}
_LIBCPP_HIDE_FROM_ABI constexpr decltype(auto) operator*() const
requires __dereferenceable<const _Iter>
{
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__hold_),
+ "Attempted to dereference a non-dereferenceable common_iterator");
return *_VSTD::__unchecked_get<_Iter>(__hold_);
}
is_reference_v<iter_reference_t<_I2>> ||
constructible_from<iter_value_t<_I2>, iter_reference_t<_I2>>)
{
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to dereference a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__hold_),
+ "Attempted to dereference a non-dereferenceable common_iterator");
if constexpr (is_pointer_v<_Iter> || requires(const _Iter& __i) { __i.operator->(); }) {
return _VSTD::__unchecked_get<_Iter>(__hold_);
} else if constexpr (is_reference_v<iter_reference_t<_Iter>>) {
}
_LIBCPP_HIDE_FROM_ABI common_iterator& operator++() {
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to increment a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__hold_),
+ "Attempted to increment a non-dereferenceable common_iterator");
++_VSTD::__unchecked_get<_Iter>(__hold_); return *this;
}
_LIBCPP_HIDE_FROM_ABI decltype(auto) operator++(int) {
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__hold_), "Attempted to increment a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__hold_),
+ "Attempted to increment a non-dereferenceable common_iterator");
if constexpr (forward_iterator<_Iter>) {
auto __tmp = *this;
++*this;
requires sentinel_for<_Sent, _I2>
_LIBCPP_HIDE_FROM_ABI
friend constexpr bool operator==(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) {
- _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
- _LIBCPP_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__x.__hold_.valueless_by_exception(),
+ "Attempted to compare a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__y.__hold_.valueless_by_exception(),
+ "Attempted to compare a valueless common_iterator");
auto __x_index = __x.__hold_.index();
auto __y_index = __y.__hold_.index();
requires sentinel_for<_Sent, _I2> && equality_comparable_with<_Iter, _I2>
_LIBCPP_HIDE_FROM_ABI
friend constexpr bool operator==(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) {
- _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
- _LIBCPP_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__x.__hold_.valueless_by_exception(),
+ "Attempted to compare a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__y.__hold_.valueless_by_exception(),
+ "Attempted to compare a valueless common_iterator");
auto __x_index = __x.__hold_.index();
auto __y_index = __y.__hold_.index();
requires sized_sentinel_for<_Sent, _I2>
_LIBCPP_HIDE_FROM_ABI
friend constexpr iter_difference_t<_I2> operator-(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) {
- _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to subtract from a valueless common_iterator");
- _LIBCPP_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to subtract a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__x.__hold_.valueless_by_exception(),
+ "Attempted to subtract from a valueless common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__y.__hold_.valueless_by_exception(),
+ "Attempted to subtract a valueless common_iterator");
auto __x_index = __x.__hold_.index();
auto __y_index = __y.__hold_.index();
noexcept(noexcept(ranges::iter_move(std::declval<const _Iter&>())))
requires input_iterator<_Iter>
{
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__i.__hold_), "Attempted to iter_move a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__i.__hold_),
+ "Attempted to iter_move a non-dereferenceable common_iterator");
return ranges::iter_move( _VSTD::__unchecked_get<_Iter>(__i.__hold_));
}
_LIBCPP_HIDE_FROM_ABI friend constexpr void iter_swap(const common_iterator& __x, const common_iterator<_I2, _S2>& __y)
noexcept(noexcept(ranges::iter_swap(std::declval<const _Iter&>(), std::declval<const _I2&>())))
{
- _LIBCPP_ASSERT(std::holds_alternative<_Iter>(__x.__hold_), "Attempted to iter_swap a non-dereferenceable common_iterator");
- _LIBCPP_ASSERT(std::holds_alternative<_I2>(__y.__hold_), "Attempted to iter_swap a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_Iter>(__x.__hold_),
+ "Attempted to iter_swap a non-dereferenceable common_iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::holds_alternative<_I2>(__y.__hold_),
+ "Attempted to iter_swap a non-dereferenceable common_iterator");
return ranges::iter_swap(_VSTD::__unchecked_get<_Iter>(__x.__hold_), _VSTD::__unchecked_get<_I2>(__y.__hold_));
}
};
_LIBCPP_HIDE_FROM_ABI
constexpr counted_iterator(_Iter __iter, iter_difference_t<_Iter> __n)
: __current_(_VSTD::move(__iter)), __count_(__n) {
- _LIBCPP_ASSERT(__n >= 0, "__n must not be negative.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n >= 0, "__n must not be negative.");
}
template<class _I2>
_LIBCPP_HIDE_FROM_ABI
constexpr decltype(auto) operator*() {
- _LIBCPP_ASSERT(__count_ > 0, "Iterator is equal to or past end.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count_ > 0, "Iterator is equal to or past end.");
return *__current_;
}
constexpr decltype(auto) operator*() const
requires __dereferenceable<const _Iter>
{
- _LIBCPP_ASSERT(__count_ > 0, "Iterator is equal to or past end.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count_ > 0, "Iterator is equal to or past end.");
return *__current_;
}
_LIBCPP_HIDE_FROM_ABI
constexpr counted_iterator& operator++() {
- _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count_ > 0, "Iterator already at or past end.");
++__current_;
--__count_;
return *this;
_LIBCPP_HIDE_FROM_ABI
decltype(auto) operator++(int) {
- _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count_ > 0, "Iterator already at or past end.");
--__count_;
#ifndef _LIBCPP_HAS_NO_EXCEPTIONS
try { return __current_++; }
constexpr counted_iterator operator++(int)
requires forward_iterator<_Iter>
{
- _LIBCPP_ASSERT(__count_ > 0, "Iterator already at or past end.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count_ > 0, "Iterator already at or past end.");
counted_iterator __tmp = *this;
++*this;
return __tmp;
constexpr counted_iterator& operator+=(iter_difference_t<_Iter> __n)
requires random_access_iterator<_Iter>
{
- _LIBCPP_ASSERT(__n <= __count_, "Cannot advance iterator past end.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n <= __count_, "Cannot advance iterator past end.");
__current_ += __n;
__count_ -= __n;
return *this;
constexpr counted_iterator& operator-=(iter_difference_t<_Iter> __n)
requires random_access_iterator<_Iter>
{
- _LIBCPP_ASSERT(-__n <= __count_, "Attempt to subtract too large of a size: "
- "counted_iterator would be decremented before the "
- "first element of its range.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(-__n <= __count_,
+ "Attempt to subtract too large of a size: "
+ "counted_iterator would be decremented before the "
+ "first element of its range.");
__current_ -= __n;
__count_ += __n;
return *this;
constexpr decltype(auto) operator[](iter_difference_t<_Iter> __n) const
requires random_access_iterator<_Iter>
{
- _LIBCPP_ASSERT(__n < __count_, "Subscript argument must be less than size.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n < __count_, "Subscript argument must be less than size.");
return __current_[__n];
}
noexcept(noexcept(ranges::iter_move(__i.__current_)))
requires input_iterator<_Iter>
{
- _LIBCPP_ASSERT(__i.__count_ > 0, "Iterator must not be past end of range.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__i.__count_ > 0, "Iterator must not be past end of range.");
return ranges::iter_move(__i.__current_);
}
friend constexpr void iter_swap(const counted_iterator& __x, const counted_iterator<_I2>& __y)
noexcept(noexcept(ranges::iter_swap(__x.__current_, __y.__current_)))
{
- _LIBCPP_ASSERT(__x.__count_ > 0 && __y.__count_ > 0,
- "Iterators must not be past end of range.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x.__count_ > 0 && __y.__count_ > 0,
+ "Iterators must not be past end of range.");
return ranges::iter_swap(__x.__current_, __y.__current_);
}
};
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
typename enable_if<__has_input_iterator_category<_InputIter>::value, _InputIter>::type
next(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n = 1) {
- _LIBCPP_ASSERT(__n >= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
- "Attempt to next(it, n) with negative n on a non-bidirectional iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n >= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
+ "Attempt to next(it, n) with negative n on a non-bidirectional iterator");
_VSTD::advance(__x, __n);
return __x;
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
typename enable_if<__has_input_iterator_category<_InputIter>::value, _InputIter>::type
prev(_InputIter __x, typename iterator_traits<_InputIter>::difference_type __n = 1) {
- _LIBCPP_ASSERT(__n <= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
- "Attempt to prev(it, n) with a positive n on a non-bidirectional iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n <= 0 || __has_bidirectional_iterator_category<_InputIter>::value,
+ "Attempt to prev(it, n) with a positive n on a non-bidirectional iterator");
_VSTD::advance(__x, -__n);
return __x;
}
}
// Precondition check
else
- _LIBCPP_ASSERT(__values[__i] == static_cast<_TDynamic>(__static_val),
- "extents construction: mismatch of provided arguments with static extents.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__values[__i] == static_cast<_TDynamic>(__static_val),
+ "extents construction: mismatch of provided arguments with static extents.");
}
}
}
// Precondition check
else
- _LIBCPP_ASSERT(static_cast<_TDynamic>(__vals[__i]) == static_cast<_TDynamic>(__static_val),
- "extents construction: mismatch of provided arguments with static extents.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(static_cast<_TDynamic>(__vals[__i]) == static_cast<_TDynamic>(__static_val),
+ "extents construction: mismatch of provided arguments with static extents.");
}
}
// access functions
_LIBCPP_HIDE_FROM_ABI static constexpr _TStatic __static_value(size_t __i) noexcept {
- _LIBCPP_ASSERT(__i < __size_, "extents access: index must be less than rank");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__i < __size_, "extents access: index must be less than rank");
return _StaticValues::__get(__i);
}
_LIBCPP_HIDE_FROM_ABI constexpr _TDynamic __value(size_t __i) const {
- _LIBCPP_ASSERT(__i < __size_, "extents access: index must be less than rank");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__i < __size_, "extents access: index must be less than rank");
_TStatic __static_val = _StaticValues::__get(__i);
return __static_val == _DynTag ? __dyn_vals_[_DynamicIdxMap::__get(__i)] : static_cast<_TDynamic>(__static_val);
}
_LIBCPP_HIDE_FROM_ABI constexpr _TDynamic operator[](size_t __i) const {
- _LIBCPP_ASSERT(__i < __size_, "extents access: index must be less than rank");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__i < __size_, "extents access: index must be less than rank");
return __value(__i);
}
(sizeof...(_OtherIndexTypes) == __rank_ || sizeof...(_OtherIndexTypes) == __rank_dynamic_))
_LIBCPP_HIDE_FROM_ABI constexpr explicit extents(_OtherIndexTypes... __dynvals) noexcept
: __vals_(static_cast<index_type>(__dynvals)...) {
- _LIBCPP_ASSERT(__mdspan_detail::__are_representable_as<index_type>(__dynvals...),
- "extents ctor: arguments must be representable as index_type and nonnegative");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__mdspan_detail::__are_representable_as<index_type>(__dynvals...),
+ "extents ctor: arguments must be representable as index_type and nonnegative");
}
template <class _OtherIndexType, size_t _Size>
explicit(_Size != __rank_dynamic_)
_LIBCPP_HIDE_FROM_ABI constexpr extents(const array<_OtherIndexType, _Size>& __exts) noexcept
: __vals_(span(__exts)) {
- _LIBCPP_ASSERT(__mdspan_detail::__are_representable_as<index_type>(span(__exts)),
- "extents ctor: arguments must be representable as index_type and nonnegative");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__mdspan_detail::__are_representable_as<index_type>(span(__exts)),
+ "extents ctor: arguments must be representable as index_type and nonnegative");
}
template <class _OtherIndexType, size_t _Size>
explicit(_Size != __rank_dynamic_)
_LIBCPP_HIDE_FROM_ABI constexpr extents(const span<_OtherIndexType, _Size>& __exts) noexcept
: __vals_(__exts) {
- _LIBCPP_ASSERT(__mdspan_detail::__are_representable_as<index_type>(__exts),
- "extents ctor: arguments must be representable as index_type and nonnegative");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__mdspan_detail::__are_representable_as<index_type>(__exts),
+ "extents ctor: arguments must be representable as index_type and nonnegative");
}
private:
for (size_t __r = 0; __r < rank(); __r++) {
if constexpr (static_cast<make_unsigned_t<index_type>>(numeric_limits<index_type>::max()) <
static_cast<make_unsigned_t<_OtherIndexType>>(numeric_limits<_OtherIndexType>::max())) {
- _LIBCPP_ASSERT(__mdspan_detail::__is_representable_as<index_type>(__other.extent(__r)),
- "extents ctor: arguments must be representable as index_type and nonnegative");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__mdspan_detail::__is_representable_as<index_type>(__other.extent(__r)),
+ "extents ctor: arguments must be representable as index_type and nonnegative");
}
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
(_Values::__static_value(__r) == dynamic_extent) ||
(static_cast<index_type>(__other.extent(__r)) == static_cast<index_type>(_Values::__static_value(__r))),
"extents construction: mismatch of provided arguments with static extents.");
if (is_constant_evaluated()) {
return __ptr;
} else {
- _LIBCPP_ASSERT(reinterpret_cast<uintptr_t>(__ptr) % _Np == 0, "Alignment assumption is violated");
+ _LIBCPP_ASSERT_UNCATEGORIZED(reinterpret_cast<uintptr_t>(__ptr) % _Np == 0, "Alignment assumption is violated");
return static_cast<_Tp*>(__builtin_assume_aligned(__ptr, _Np));
}
}
template <class _Tp, class... _Args, class = decltype(::new(std::declval<void*>()) _Tp(std::declval<_Args>()...))>
_LIBCPP_HIDE_FROM_ABI constexpr _Tp* construct_at(_Tp* __location, _Args&&... __args) {
- _LIBCPP_ASSERT(__location != nullptr, "null pointer given to construct_at");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__location != nullptr, "null pointer given to construct_at");
return ::new (std::__voidify(*__location)) _Tp(std::forward<_Args>(__args)...);
}
#if _LIBCPP_STD_VER >= 20
return std::construct_at(__location, std::forward<_Args>(__args)...);
#else
- return _LIBCPP_ASSERT(__location != nullptr, "null pointer given to construct_at"),
+ return _LIBCPP_ASSERT_UNCATEGORIZED(__location != nullptr, "null pointer given to construct_at"),
::new (std::__voidify(*__location)) _Tp(std::forward<_Args>(__args)...);
#endif
}
template <class _Tp, typename enable_if<!is_array<_Tp>::value, int>::type = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void __destroy_at(_Tp* __loc) {
- _LIBCPP_ASSERT(__loc != nullptr, "null pointer given to destroy_at");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__loc != nullptr, "null pointer given to destroy_at");
__loc->~_Tp();
}
template <class _Tp, typename enable_if<is_array<_Tp>::value, int>::type = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void __destroy_at(_Tp* __loc) {
- _LIBCPP_ASSERT(__loc != nullptr, "null pointer given to destroy_at");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__loc != nullptr, "null pointer given to destroy_at");
std::__destroy(std::begin(*__loc), std::end(*__loc));
}
#endif
}
_LIBCPP_HIDE_FROM_ABI void deallocate(_ValueType* __p, size_t __n) {
- _LIBCPP_ASSERT(__n <= __max_size(), "deallocate called for size which exceeds max_size()");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n <= __max_size(), "deallocate called for size which exceeds max_size()");
__res_->deallocate(__p, __n * sizeof(_ValueType), alignof(_ValueType));
}
_LIBCPP_INLINE_VISIBILITY
__basic_node_handle& operator=(__basic_node_handle&& __other)
{
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__alloc_ == _VSTD::nullopt ||
__alloc_traits::propagate_on_container_move_assignment::value ||
__alloc_ == __other.__alloc_,
using _Rp = common_type_t<_Tp,_Up>;
_Rp __val1 = __ct_abs<_Rp, _Tp>()(__m) / _VSTD::gcd(__m, __n);
_Rp __val2 = __ct_abs<_Rp, _Up>()(__n);
- _LIBCPP_ASSERT((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm");
+ _LIBCPP_ASSERT_UNCATEGORIZED((numeric_limits<_Rp>::max() / __val1 > __val2), "Overflow in lcm");
return __val1 * __val2;
}
__first2,
__last2,
[__first1, __last1, __first2, __last2, &__comp](_RandomAccessIterator2 __i, _RandomAccessIterator2 __j) {
- _LIBCPP_ASSERT(__j > __i, "");
- //_LIBCPP_ASSERT(__j - __i > 1, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__j > __i, "");
+ //_LIBCPP_ASSERT_UNCATEGORIZED(__j - __i > 1, "");
// 1. moving boundaries to "consume" subsequence of equal elements
auto __is_equal = [&__comp](_RandomAccessIterator2 __a, _RandomAccessIterator2 __b) -> bool {
// 2. testing is __a subsequence of the second range included into the first range
auto __b = std::lower_bound(__first1, __last1, *__i, __comp);
- _LIBCPP_ASSERT(!__comp(*(__last1 - 1), *__b), "");
- _LIBCPP_ASSERT(!__comp(*(__j - 1), *__i), "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__comp(*(__last1 - 1), *__b), "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__comp(*(__j - 1), *__i), "");
return !std::includes(__b, __last1, __i, __j, __comp);
});
});
}
const auto __m2 = __left_bound_seq_2 - __first2;
- _LIBCPP_ASSERT(__m1 == 0 || __m2 == 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__m1 == 0 || __m2 == 0, "");
if (__m2 > __set_algo_cut_off) {
auto __res_or = __result;
__result += __m2; // we know proper offset due to [first2; left_bound_seq_2) < [first1; last1)
_RandomAccessIterator2 __d_first,
BinaryOperation __op,
/*is_vector=*/std::true_type) noexcept {
- _LIBCPP_ASSERT(__first != __last, "Range cannot be empty");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first != __last, "Range cannot be empty");
typedef typename std::iterator_traits<_RandomAccessIterator1>::reference _ReferenceType1;
typedef typename std::iterator_traits<_RandomAccessIterator2>::reference _ReferenceType2;
_RandomAccessIterator1 __last,
_RandomAccessIterator2 __d_first,
_BinaryOperation __op) {
- _LIBCPP_ASSERT(__first != __last, "range cannot be empty");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first != __last, "range cannot be empty");
typedef typename std::iterator_traits<_RandomAccessIterator1>::reference _ReferenceType1;
typedef typename std::iterator_traits<_RandomAccessIterator2>::reference _ReferenceType2;
__task*
allocate_func_task(_Fn&& __f)
{
- _LIBCPP_ASSERT(_M_execute_data != nullptr, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_M_execute_data != nullptr, "");
tbb::detail::d1::small_object_allocator __alloc{};
auto __t =
__alloc.new_object<__func_task<typename std::decay<_Fn>::type>>(*_M_execute_data, std::forward<_Fn>(__f));
make_additional_child_of(__task* __parent, _Fn&& __f)
{
auto __t = make_child_of(__parent, std::forward<_Fn>(__f));
- _LIBCPP_ASSERT(__parent->_M_refcount.load(std::memory_order_relaxed) > 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__parent->_M_refcount.load(std::memory_order_relaxed) > 0, "");
++__parent->_M_refcount;
return __t;
}
inline void
spawn(__task* __t)
{
- _LIBCPP_ASSERT(_M_execute_data != nullptr, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_M_execute_data != nullptr, "");
tbb::detail::d1::spawn(*__t, *_M_execute_data->context);
}
this->~__func_task();
- _LIBCPP_ASSERT(__parent != nullptr, "");
- _LIBCPP_ASSERT(__parent->_M_refcount.load(std::memory_order_relaxed) > 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__parent != nullptr, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__parent->_M_refcount.load(std::memory_order_relaxed) > 0, "");
if (--__parent->_M_refcount == 0)
{
- _LIBCPP_ASSERT(__next == nullptr, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__next == nullptr, "");
__alloc.deallocate(this, *__ed);
return __parent;
}
{
const auto __nx = (_M_xe - _M_xs);
const auto __ny = (_M_ye - _M_ys);
- _LIBCPP_ASSERT(__nx > 0 && __ny > 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nx > 0 && __ny > 0, "");
- _LIBCPP_ASSERT(_x_orig == _y_orig, "");
- _LIBCPP_ASSERT(!is_partial(), "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_x_orig == _y_orig, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!is_partial(), "");
if (_x_orig)
{
- _LIBCPP_ASSERT(std::is_sorted(_M_x_beg + _M_xs, _M_x_beg + _M_xe, _M_comp), "");
- _LIBCPP_ASSERT(std::is_sorted(_M_x_beg + _M_ys, _M_x_beg + _M_ye, _M_comp), "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::is_sorted(_M_x_beg + _M_xs, _M_x_beg + _M_xe, _M_comp), "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::is_sorted(_M_x_beg + _M_ys, _M_x_beg + _M_ye, _M_comp), "");
return !_M_comp(*(_M_x_beg + _M_ys), *(_M_x_beg + _M_xe - 1));
}
- _LIBCPP_ASSERT(std::is_sorted(_M_z_beg + _M_xs, _M_z_beg + _M_xe, _M_comp), "");
- _LIBCPP_ASSERT(std::is_sorted(_M_z_beg + _M_ys, _M_z_beg + _M_ye, _M_comp), "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::is_sorted(_M_z_beg + _M_xs, _M_z_beg + _M_xe, _M_comp), "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(std::is_sorted(_M_z_beg + _M_ys, _M_z_beg + _M_ye, _M_comp), "");
return !_M_comp(*(_M_z_beg + _M_zs + __nx), *(_M_z_beg + _M_zs + __nx - 1));
}
void
{
const auto __nx = (_M_xe - _M_xs);
const auto __ny = (_M_ye - _M_ys);
- _LIBCPP_ASSERT(__nx > 0 && __ny > 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nx > 0 && __ny > 0, "");
if (_x_orig)
__move_range_construct()(_M_x_beg + _M_xs, _M_x_beg + _M_xe, _M_z_beg + _M_zs);
__task*
merge_ranges(__task* __self)
{
- _LIBCPP_ASSERT(_x_orig == _y_orig, ""); //two merged subrange must be lie into the same buffer
+ _LIBCPP_ASSERT_UNCATEGORIZED(_x_orig == _y_orig, ""); // two merged subrange must be lie into the same buffer
const auto __nx = (_M_xe - _M_xs);
const auto __ny = (_M_ye - _M_ys);
_M_leaf_merge(_M_x_beg + _M_xs, _M_x_beg + _M_xe, _M_x_beg + _M_ys, _M_x_beg + _M_ye, _M_z_beg + _M_zs,
_M_comp, __move_value_construct(), __move_value_construct(), __move_range_construct(),
__move_range_construct());
- _LIBCPP_ASSERT(parent_merge(__self), ""); //not root merging task
+ _LIBCPP_ASSERT_UNCATEGORIZED(parent_merge(__self), ""); //not root merging task
}
//merge to "origin"
else
{
- _LIBCPP_ASSERT(_x_orig == _y_orig, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_x_orig == _y_orig, "");
- _LIBCPP_ASSERT(is_partial() || std::is_sorted(_M_z_beg + _M_xs, _M_z_beg + _M_xe, _M_comp), "");
- _LIBCPP_ASSERT(is_partial() || std::is_sorted(_M_z_beg + _M_ys, _M_z_beg + _M_ye, _M_comp), "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ is_partial() || std::is_sorted(_M_z_beg + _M_xs, _M_z_beg + _M_xe, _M_comp), "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ is_partial() || std::is_sorted(_M_z_beg + _M_ys, _M_z_beg + _M_ye, _M_comp), "");
const auto __nx = (_M_xe - _M_xs);
const auto __ny = (_M_ye - _M_ys);
__task*
process_ranges(__task* __self)
{
- _LIBCPP_ASSERT(_x_orig == _y_orig, "");
- _LIBCPP_ASSERT(!_split, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_x_orig == _y_orig, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!_split, "");
auto p = parent_merge(__self);
__task*
split_merging(__task* __self)
{
- _LIBCPP_ASSERT(_x_orig == _y_orig, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_x_orig == _y_orig, "");
const auto __nx = (_M_xe - _M_xs);
const auto __ny = (_M_ye - _M_ys);
{
const _SizeType __nx = (_M_xe - _M_xs);
const _SizeType __ny = (_M_ye - _M_ys);
- _LIBCPP_ASSERT(__nx > 0, "");
- _LIBCPP_ASSERT(__nx > 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nx > 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nx > 0, "");
if (__nx < __ny)
move_x_range();
if (__n <= __sort_cut_off)
{
_M_leaf_sort(_M_xs, _M_xe, _M_comp);
- _LIBCPP_ASSERT(!_M_root, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!_M_root, "");
return nullptr;
}
constexpr bool __same_move_seq = std::is_same<_MoveSequenceX, _MoveSequenceY>::value;
auto __n = _M_nmerge;
- _LIBCPP_ASSERT(__n > 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n > 0, "");
auto __nx = __xe - __xs;
//auto __ny = __ye - __ys;
else
++__f;
}
- _LIBCPP_ASSERT(__f >= 0, "std::negative_binomial_distribution should never produce negative values. "
- "This is almost certainly a signed integer overflow issue on __f.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__f >= 0,
+ "std::negative_binomial_distribution should never produce negative values. "
+ "This is almost certainly a signed integer overflow issue on __f.");
return __f;
}
return poisson_distribution<result_type>(gamma_distribution<double>
: __count_(__count)
, __base_(std::move(__base))
{
- _LIBCPP_ASSERT(__count_ >= 0, "count must be greater than or equal to zero.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count_ >= 0, "count must be greater than or equal to zero.");
}
_LIBCPP_HIDE_FROM_ABI constexpr _View base() const& requires copy_constructible<_View> { return __base_; }
_LIBCPP_HIDE_FROM_ABI constexpr const _Pred& pred() const { return *__pred_; }
_LIBCPP_HIDE_FROM_ABI constexpr auto begin() {
- _LIBCPP_ASSERT(__pred_.__has_value(),
- "drop_while_view needs to have a non-empty predicate before calling begin() -- did a previous "
- "assignment to this drop_while_view fail?");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __pred_.__has_value(),
+ "drop_while_view needs to have a non-empty predicate before calling begin() -- did a previous "
+ "assignment to this drop_while_view fail?");
if constexpr (_UseCache) {
if (!__cached_begin_.__has_value()) {
__cached_begin_.__emplace(ranges::find_if_not(__base_, std::cref(*__pred_)));
_LIBCPP_HIDE_FROM_ABI
constexpr __iterator begin() {
- _LIBCPP_ASSERT(__pred_.__has_value(), "Trying to call begin() on a filter_view that does not have a valid predicate.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __pred_.__has_value(),
+ "Trying to call begin() on a filter_view that does not have a valid predicate.");
if constexpr (_UseCache) {
if (!__cached_begin_.__has_value()) {
__cached_begin_.__emplace(ranges::find_if(__base_, std::ref(*__pred_)));
: __value_(std::move(__value)), __bound_sentinel_(std::move(__bound_sentinel)) {
// Validate the precondition if possible.
if constexpr (totally_ordered_with<_Start, _BoundSentinel>) {
- _LIBCPP_ASSERT(ranges::less_equal()(__value_, __bound_sentinel_),
- "Precondition violated: value is greater than bound.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ranges::less_equal()(__value_, __bound_sentinel_),
+ "Precondition violated: value is greater than bound.");
}
}
_LIBCPP_HIDE_FROM_ABI
friend constexpr bool operator==(const __outer_iterator& __x, default_sentinel_t) {
- _LIBCPP_ASSERT(__x.__parent_, "Cannot call comparison on a default-constructed iterator.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x.__parent_, "Cannot call comparison on a default-constructed iterator.");
return __x.__current() == ranges::end(__x.__parent_base()) && !__x.__trailing_empty_;
}
};
_LIBCPP_HIDE_FROM_ABI
constexpr bool __is_done() const {
- _LIBCPP_ASSERT(__i_.__parent_, "Cannot call comparison on a default-constructed iterator.");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__i_.__parent_, "Cannot call comparison on a default-constructed iterator.");
auto [__pcur, __pend] = ranges::subrange{__i_.__parent_->__pattern_};
auto __end = ranges::end(__i_.__parent_->__base_);
: __begin_(std::move(__iter)), __end_(std::move(__sent)), __size_(__n)
{
if constexpr (sized_sentinel_for<_Sent, _Iter>)
- _LIBCPP_ASSERT((__end_ - __begin_) == static_cast<iter_difference_t<_Iter>>(__n),
+ _LIBCPP_ASSERT_UNCATEGORIZED((__end_ - __begin_) == static_cast<iter_difference_t<_Iter>>(__n),
"std::ranges::subrange was passed an invalid size hint");
}
_LIBCPP_HIDE_FROM_ABI
constexpr _LIBCPP_EXPLICIT_SINCE_CXX23 take_view(_View __base, range_difference_t<_View> __count)
: __base_(std::move(__base)), __count_(__count) {
- _LIBCPP_ASSERT(__count >= 0, "count has to be greater than or equal to zero");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count >= 0, "count has to be greater than or equal to zero");
}
_LIBCPP_HIDE_FROM_ABI
constexpr decltype(auto) front()
requires forward_range<_D2>
{
- _LIBCPP_ASSERT(!empty(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(),
"Precondition `!empty()` not satisfied. `.front()` called on an empty view.");
return *ranges::begin(__derived());
}
constexpr decltype(auto) front() const
requires forward_range<const _D2>
{
- _LIBCPP_ASSERT(!empty(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(),
"Precondition `!empty()` not satisfied. `.front()` called on an empty view.");
return *ranges::begin(__derived());
}
constexpr decltype(auto) back()
requires bidirectional_range<_D2> && common_range<_D2>
{
- _LIBCPP_ASSERT(!empty(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(),
"Precondition `!empty()` not satisfied. `.back()` called on an empty view.");
return *ranges::prev(ranges::end(__derived()));
}
constexpr decltype(auto) back() const
requires bidirectional_range<const _D2> && common_range<const _D2>
{
- _LIBCPP_ASSERT(!empty(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(),
"Precondition `!empty()` not satisfied. `.back()` called on an empty view.");
return *ranges::prev(ranges::end(__derived()));
}
__node->__next_->__prev_ = __node->__prev_;
}
} else {
- _LIBCPP_ASSERT(__node == __head_, "Node to be removed has no prev node, so it has to be the head");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__node == __head_, "Node to be removed has no prev node, so it has to be the head");
__pop_front();
}
}
_LIBCPP_HIDE_FROM_ABI __stop_state() noexcept = default;
_LIBCPP_HIDE_FROM_ABI void __increment_stop_source_counter() noexcept {
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__state_.load(std::memory_order_relaxed) <= static_cast<__state_t>(~(1 << __stop_source_counter_shift)),
"stop_source's counter reaches the maximum. Incrementing the counter will overflow");
__state_.fetch_add(1 << __stop_source_counter_shift, std::memory_order_relaxed);
// We are not destroying the object after counter decrements to zero, nor do we have
// operations depend on the ordering of decrementing the counter. relaxed is enough.
_LIBCPP_HIDE_FROM_ABI void __decrement_stop_source_counter() noexcept {
- _LIBCPP_ASSERT(__state_.load(std::memory_order_relaxed) >= static_cast<__state_t>(1 << __stop_source_counter_shift),
- "stop_source's counter is 0. Decrementing the counter will underflow");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __state_.load(std::memory_order_relaxed) >= static_cast<__state_t>(1 << __stop_source_counter_shift),
+ "stop_source's counter is 0. Decrementing the counter will underflow");
__state_.fetch_sub(1 << __stop_source_counter_shift, std::memory_order_relaxed);
}
static _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) {
if (!__libcpp_is_constant_evaluated()) {
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
}
char_type* __r = __s1;
for (; __n; --__n, ++__s1, ++__s2)
static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
if (!__libcpp_is_constant_evaluated())
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
std::copy_n(__s2, __n, __s1);
return __s1;
}
static inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
if (!__libcpp_is_constant_evaluated())
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
std::copy_n(__s2, __n, __s1);
return __s1;
}
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
if (!__libcpp_is_constant_evaluated())
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
std::copy_n(__s2, __n, __s1);
return __s1;
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
static char_type* copy(char_type* __s1, const char_type* __s2, size_t __n) _NOEXCEPT {
if (!__libcpp_is_constant_evaluated())
- _LIBCPP_ASSERT(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s2 < __s1 || __s2 >= __s1+__n, "char_traits::copy overlapped range");
std::copy_n(__s2, __n, __s1);
return __s1;
}
void
__thread_specific_ptr<_Tp>::set_pointer(pointer __p)
{
- _LIBCPP_ASSERT(get() == nullptr,
+ _LIBCPP_ASSERT_UNCATEGORIZED(get() == nullptr,
"Attempting to overwrite thread local data");
std::__libcpp_tls_set(__key_, __p);
}
_NodePtr
__tree_min(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "Root node shouldn't be null");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x != nullptr, "Root node shouldn't be null");
while (__x->__left_ != nullptr)
__x = __x->__left_;
return __x;
_NodePtr
__tree_max(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "Root node shouldn't be null");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x != nullptr, "Root node shouldn't be null");
while (__x->__right_ != nullptr)
__x = __x->__right_;
return __x;
_LIBCPP_HIDE_FROM_ABI _NodePtr
__tree_next(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x != nullptr, "node shouldn't be null");
if (__x->__right_ != nullptr)
return _VSTD::__tree_min(__x->__right_);
while (!_VSTD::__tree_is_left_child(__x))
_EndNodePtr
__tree_next_iter(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x != nullptr, "node shouldn't be null");
if (__x->__right_ != nullptr)
return static_cast<_EndNodePtr>(_VSTD::__tree_min(__x->__right_));
while (!_VSTD::__tree_is_left_child(__x))
_NodePtr
__tree_prev_iter(_EndNodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x != nullptr, "node shouldn't be null");
if (__x->__left_ != nullptr)
return _VSTD::__tree_max(__x->__left_);
_NodePtr __xx = static_cast<_NodePtr>(__x);
_LIBCPP_HIDE_FROM_ABI _NodePtr
__tree_leaf(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x != nullptr, "node shouldn't be null");
while (true)
{
if (__x->__left_ != nullptr)
_LIBCPP_HIDE_FROM_ABI void
__tree_left_rotate(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
- _LIBCPP_ASSERT(__x->__right_ != nullptr, "node should have a right child");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x != nullptr, "node shouldn't be null");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x->__right_ != nullptr, "node should have a right child");
_NodePtr __y = __x->__right_;
__x->__right_ = __y->__left_;
if (__x->__right_ != nullptr)
_LIBCPP_HIDE_FROM_ABI void
__tree_right_rotate(_NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null");
- _LIBCPP_ASSERT(__x->__left_ != nullptr, "node should have a left child");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x != nullptr, "node shouldn't be null");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x->__left_ != nullptr, "node should have a left child");
_NodePtr __y = __x->__left_;
__x->__left_ = __y->__right_;
if (__x->__left_ != nullptr)
_LIBCPP_HIDE_FROM_ABI void
__tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT
{
- _LIBCPP_ASSERT(__root != nullptr, "Root of the tree shouldn't be null");
- _LIBCPP_ASSERT(__x != nullptr, "Can't attach null node to a leaf");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__root != nullptr, "Root of the tree shouldn't be null");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__x != nullptr, "Can't attach null node to a leaf");
__x->__is_black_ = __x == __root;
while (__x != __root && !__x->__parent_unsafe()->__is_black_)
{
_LIBCPP_HIDE_FROM_ABI void
__tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT
{
- _LIBCPP_ASSERT(__root != nullptr, "Root node should not be null");
- _LIBCPP_ASSERT(__z != nullptr, "The node to remove should not be null");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__root != nullptr, "Root node should not be null");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__z != nullptr, "The node to remove should not be null");
_LIBCPP_DEBUG_ASSERT(std::__tree_invariant(__root), "The tree invariants should hold");
// __z will be removed from the tree. Client still needs to destruct/deallocate it
// __y is either __z, or if __z has two children, __tree_next(__z).
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_NODEBUG ~__exception_guard_noexceptions() {
- _LIBCPP_ASSERT(__completed_, "__exception_guard not completed with exceptions disabled");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__completed_, "__exception_guard not completed with exceptions disabled");
}
private:
"__is_pointer_in_range should not be called with member pointers");
if (__libcpp_is_constant_evaluated()) {
- _LIBCPP_ASSERT(__builtin_constant_p(__begin <= __end), "__begin and __end do not form a range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__builtin_constant_p(__begin <= __end), "__begin and __end do not form a range");
// If this is not a constant during constant evaluation we know that __ptr is not part of the allocation where
// [__begin, __end) is.
_LIBCPP_BEGIN_NAMESPACE_STD
_LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI inline void __libcpp_unreachable() {
- _LIBCPP_ASSERT(false, "std::unreachable() was reached");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "std::unreachable() was reached");
__builtin_unreachable();
}
// element access:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reference operator[](size_type __n) _NOEXCEPT {
- _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n < _Size, "out-of-bounds access in std::array<T, N>");
return __elems_[__n];
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const_reference operator[](size_type __n) const _NOEXCEPT {
- _LIBCPP_ASSERT(__n < _Size, "out-of-bounds access in std::array<T, N>");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n < _Size, "out-of-bounds access in std::array<T, N>");
return __elems_[__n];
}
// element access:
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reference operator[](size_type) _NOEXCEPT {
- _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
__libcpp_unreachable();
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const_reference operator[](size_type) const _NOEXCEPT {
- _LIBCPP_ASSERT(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "cannot call array<T, 0>::operator[] on a zero-sized array");
__libcpp_unreachable();
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reference front() _NOEXCEPT {
- _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "cannot call array<T, 0>::front() on a zero-sized array");
__libcpp_unreachable();
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const_reference front() const _NOEXCEPT {
- _LIBCPP_ASSERT(false, "cannot call array<T, 0>::front() on a zero-sized array");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "cannot call array<T, 0>::front() on a zero-sized array");
__libcpp_unreachable();
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
reference back() _NOEXCEPT {
- _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "cannot call array<T, 0>::back() on a zero-sized array");
__libcpp_unreachable();
}
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
const_reference back() const _NOEXCEPT {
- _LIBCPP_ASSERT(false, "cannot call array<T, 0>::back() on a zero-sized array");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "cannot call array<T, 0>::back() on a zero-sized array");
__libcpp_unreachable();
}
};
void
deque<_Tp, _Allocator>::pop_back()
{
- _LIBCPP_ASSERT(!empty(), "deque::pop_back called on an empty deque");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "deque::pop_back called on an empty deque");
size_type __old_sz = size();
size_type __old_start = __start_;
allocator_type& __a = __alloc();
inline _LIBCPP_INLINE_VISIBILITY
size_t __aligned_allocation_size(size_t __s, size_t __a) _NOEXCEPT
{
- _LIBCPP_ASSERT(__s + __a > __s, "aligned allocation size overflows");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s + __a > __s, "aligned allocation size overflows");
return (__s + __a - 1) & ~(__a - 1);
}
_LIBCPP_INLINE_VISIBILITY
void deallocate(_ValueType * __p, size_t __n) _NOEXCEPT {
- _LIBCPP_ASSERT(__n <= __max_size(),
- "deallocate called for size which exceeds max_size()");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n <= __max_size(),
+ "deallocate called for size which exceeds max_size()");
__res_->deallocate(__p, __n * sizeof(_ValueType), _LIBCPP_ALIGNOF(_ValueType));
}
_LIBCPP_HIDE_FROM_ABI_VIRTUAL void do_deallocate(void * __p, size_t __bytes, size_t) override
{
- _LIBCPP_ASSERT(__bytes <= __max_size(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__bytes <= __max_size(),
"do_deallocate called for size which exceeds the maximum allocation size");
size_t __s = __aligned_allocation_size(__bytes, _MaxAlign) / _MaxAlign;
__alloc_.deallocate((_ValueType*)__p, __s);
else
{
if (__extbufend_ != __extbufnext_) {
- _LIBCPP_ASSERT(__extbufnext_ != nullptr, "underflow moving from nullptr");
- _LIBCPP_ASSERT(__extbuf_ != nullptr, "underflow moving into nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__extbufnext_ != nullptr, "underflow moving from nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__extbuf_ != nullptr, "underflow moving into nullptr");
_VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
}
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
void
promise<_Rp>::set_exception(exception_ptr __p)
{
- _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" );
+ _LIBCPP_ASSERT_UNCATEGORIZED( __p != nullptr, "promise::set_exception: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception(__p);
void
promise<_Rp>::set_exception_at_thread_exit(exception_ptr __p)
{
- _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
+ _LIBCPP_ASSERT_UNCATEGORIZED( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception_at_thread_exit(__p);
void
promise<_Rp&>::set_exception(exception_ptr __p)
{
- _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception: received nullptr" );
+ _LIBCPP_ASSERT_UNCATEGORIZED( __p != nullptr, "promise::set_exception: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception(__p);
void
promise<_Rp&>::set_exception_at_thread_exit(exception_ptr __p)
{
- _LIBCPP_ASSERT( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
+ _LIBCPP_ASSERT_UNCATEGORIZED( __p != nullptr, "promise::set_exception_at_thread_exit: received nullptr" );
if (__state_ == nullptr)
__throw_future_error(future_errc::no_state);
__state_->set_exception_at_thread_exit(__p);
__is_nothrow_swappable<allocator_type>::value)
#endif
{
- _LIBCPP_ASSERT(__alloc_traits::propagate_on_container_swap::value ||
- this->__node_alloc() == __c.__node_alloc(),
- "list::swap: Either propagate_on_container_swap must be true"
- " or the allocators must compare equal");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__alloc_traits::propagate_on_container_swap::value ||
+ this->__node_alloc() == __c.__node_alloc(),
+ "list::swap: Either propagate_on_container_swap must be true"
+ " or the allocators must compare equal");
using _VSTD::swap;
_VSTD::__swap_allocator(__node_alloc(), __c.__node_alloc());
swap(__sz(), __c.__sz());
_LIBCPP_INLINE_VISIBILITY
reference front()
{
- _LIBCPP_ASSERT(!empty(), "list::front called on empty list");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "list::front called on empty list");
return base::__end_.__next_->__as_node()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
const_reference front() const
{
- _LIBCPP_ASSERT(!empty(), "list::front called on empty list");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "list::front called on empty list");
return base::__end_.__next_->__as_node()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
reference back()
{
- _LIBCPP_ASSERT(!empty(), "list::back called on empty list");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "list::back called on empty list");
return base::__end_.__prev_->__as_node()->__value_;
}
_LIBCPP_INLINE_VISIBILITY
const_reference back() const
{
- _LIBCPP_ASSERT(!empty(), "list::back called on empty list");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "list::back called on empty list");
return base::__end_.__prev_->__as_node()->__value_;
}
void
list<_Tp, _Alloc>::pop_front()
{
- _LIBCPP_ASSERT(!empty(), "list::pop_front() called with empty list");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "list::pop_front() called with empty list");
__node_allocator& __na = base::__node_alloc();
__link_pointer __n = base::__end_.__next_;
base::__unlink_nodes(__n, __n);
void
list<_Tp, _Alloc>::pop_back()
{
- _LIBCPP_ASSERT(!empty(), "list::pop_back() called on an empty list");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "list::pop_back() called on an empty list");
__node_allocator& __na = base::__node_alloc();
__link_pointer __n = base::__end_.__prev_;
base::__unlink_nodes(__n, __n);
{
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
"list::erase(iterator) called with an iterator not referring to this list");
- _LIBCPP_ASSERT(__p != end(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__p != end(),
"list::erase(iterator) called with a non-dereferenceable iterator");
__node_allocator& __na = base::__node_alloc();
__link_pointer __n = __p.__ptr_;
void
list<_Tp, _Alloc>::splice(const_iterator __p, list& __c)
{
- _LIBCPP_ASSERT(this != _VSTD::addressof(__c),
- "list::splice(iterator, list) called with this == &list");
+ _LIBCPP_ASSERT_UNCATEGORIZED(this != _VSTD::addressof(__c),
+ "list::splice(iterator, list) called with this == &list");
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(_VSTD::addressof(__p)) == this,
"list::splice(iterator, list) called with an iterator not referring to this list");
if (!__c.empty())
else
{
if (__extbufend_ != __extbufnext_) {
- _LIBCPP_ASSERT(__extbufnext_ != nullptr, "underflow moving from nullptr");
- _LIBCPP_ASSERT(__extbuf_ != nullptr, "underflow moving into nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__extbufnext_ != nullptr, "underflow moving from nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__extbuf_ != nullptr, "underflow moving into nullptr");
_VSTD::memmove(__extbuf_, __extbufnext_, __extbufend_ - __extbufnext_);
}
__extbufnext_ = __extbuf_ + (__extbufend_ - __extbufnext_);
_LIBCPP_INLINE_VISIBILITY
insert_return_type insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to map::insert()");
return __tree_.template __node_handle_insert_unique<
node_type, insert_return_type>(_VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to map::insert()");
return __tree_.template __node_handle_insert_unique<node_type>(
__hint.__i_, _VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
void merge(map<key_type, mapped_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
template <class _Compare2>
_LIBCPP_INLINE_VISIBILITY
void merge(map<key_type, mapped_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
template <class _Compare2>
_LIBCPP_INLINE_VISIBILITY
void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
template <class _Compare2>
_LIBCPP_INLINE_VISIBILITY
void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
#endif
_LIBCPP_INLINE_VISIBILITY
iterator insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to multimap::insert()");
return __tree_.template __node_handle_insert_multi<node_type>(
_VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to multimap::insert()");
return __tree_.template __node_handle_insert_multi<node_type>(
__hint.__i_, _VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __tree_.__node_handle_merge_multi(__source.__tree_);
}
template <class _Compare2>
_LIBCPP_INLINE_VISIBILITY
void merge(multimap<key_type, mapped_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __tree_.__node_handle_merge_multi(__source.__tree_);
}
template <class _Compare2>
_LIBCPP_INLINE_VISIBILITY
void merge(map<key_type, mapped_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __tree_.__node_handle_merge_multi(__source.__tree_);
}
template <class _Compare2>
_LIBCPP_INLINE_VISIBILITY
void merge(map<key_type, mapped_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __tree_.__node_handle_merge_multi(__source.__tree_);
}
#endif
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct(_Args&&... __args)
{
- _LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!has_value(), "__construct called for engaged __optional_storage");
#if _LIBCPP_STD_VER >= 20
_VSTD::construct_at(_VSTD::addressof(this->__val_), _VSTD::forward<_Args>(__args)...);
#else
_LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR_SINCE_CXX20 void __construct(_UArg&& __val)
{
- _LIBCPP_ASSERT(!has_value(), "__construct called for engaged __optional_storage");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!has_value(), "__construct called for engaged __optional_storage");
static_assert(__can_bind_reference<_UArg>(),
"Attempted to construct a reference element in tuple from a "
"possible temporary");
add_pointer_t<value_type const>
operator->() const
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(this->has_value(), "optional operator-> called on a disengaged value");
return _VSTD::addressof(this->__get());
}
add_pointer_t<value_type>
operator->()
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator-> called on a disengaged value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(this->has_value(), "optional operator-> called on a disengaged value");
return _VSTD::addressof(this->__get());
}
const value_type&
operator*() const& noexcept
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(this->has_value(), "optional operator* called on a disengaged value");
return this->__get();
}
value_type&
operator*() & noexcept
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(this->has_value(), "optional operator* called on a disengaged value");
return this->__get();
}
value_type&&
operator*() && noexcept
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(this->has_value(), "optional operator* called on a disengaged value");
return _VSTD::move(this->__get());
}
const value_type&&
operator*() const&& noexcept
{
- _LIBCPP_ASSERT(this->has_value(), "optional operator* called on a disengaged value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(this->has_value(), "optional operator* called on a disengaged value");
return _VSTD::move(this->__get());
}
_LIBCPP_INLINE_VISIBILITY
difference_type length(size_type __sub = 0) const
{
- _LIBCPP_ASSERT(ready(), "match_results::length() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::length() called when not ready");
return (*this)[__sub].length();
}
_LIBCPP_INLINE_VISIBILITY
difference_type position(size_type __sub = 0) const
{
- _LIBCPP_ASSERT(ready(), "match_results::position() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::position() called when not ready");
return _VSTD::distance(__position_start_, (*this)[__sub].first);
}
_LIBCPP_INLINE_VISIBILITY
string_type str(size_type __sub = 0) const
{
- _LIBCPP_ASSERT(ready(), "match_results::str() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::str() called when not ready");
return (*this)[__sub].str();
}
_LIBCPP_INLINE_VISIBILITY
const_reference operator[](size_type __n) const
{
- _LIBCPP_ASSERT(ready(), "match_results::operator[]() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::operator[]() called when not ready");
return __n < __matches_.size() ? __matches_[__n] : __unmatched_;
}
_LIBCPP_INLINE_VISIBILITY
const_reference prefix() const
{
- _LIBCPP_ASSERT(ready(), "match_results::prefix() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::prefix() called when not ready");
return __prefix_;
}
_LIBCPP_INLINE_VISIBILITY
const_reference suffix() const
{
- _LIBCPP_ASSERT(ready(), "match_results::suffix() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::suffix() called when not ready");
return __suffix_;
}
const char_type* __fmt_first, const char_type* __fmt_last,
regex_constants::match_flag_type __flags) const
{
- _LIBCPP_ASSERT(ready(), "match_results::format() called when not ready");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ready(), "match_results::format() called when not ready");
if (__flags & regex_constants::format_sed)
{
for (; __fmt_first != __fmt_last; ++__fmt_first)
_LIBCPP_INLINE_VISIBILITY
insert_return_type insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to set::insert()");
return __tree_.template __node_handle_insert_unique<
node_type, insert_return_type>(_VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to set::insert()");
return __tree_.template __node_handle_insert_unique<node_type>(
__hint, _VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
void merge(set<key_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
_LIBCPP_INLINE_VISIBILITY
void merge(set<key_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
_LIBCPP_INLINE_VISIBILITY
void merge(multiset<key_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
_LIBCPP_INLINE_VISIBILITY
void merge(multiset<key_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_unique(__source.__tree_);
}
_LIBCPP_INLINE_VISIBILITY
iterator insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to multiset::insert()");
return __tree_.template __node_handle_insert_multi<node_type>(
_VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to multiset::insert()");
return __tree_.template __node_handle_insert_multi<node_type>(
__hint, _VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
void merge(multiset<key_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_multi(__source.__tree_);
}
_LIBCPP_INLINE_VISIBILITY
void merge(multiset<key_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_multi(__source.__tree_);
}
_LIBCPP_INLINE_VISIBILITY
void merge(set<key_type, _Compare2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_multi(__source.__tree_);
}
_LIBCPP_INLINE_VISIBILITY
void merge(set<key_type, _Compare2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
"merging container with incompatible allocator");
__tree_.__node_handle_merge_multi(__source.__tree_);
}
constexpr explicit span(_It __first, size_type __count)
: __data_{_VSTD::to_address(__first)} {
(void)__count;
- _LIBCPP_ASSERT(_Extent == __count, "size mismatch in span's constructor (iterator, len)");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Extent == __count, "size mismatch in span's constructor (iterator, len)");
}
template <__span_compatible_iterator<element_type> _It, __span_compatible_sentinel_for<_It> _End>
// [span.cons]/10
// Throws: When and what last - first throws.
[[maybe_unused]] auto __dist = __last - __first;
- _LIBCPP_ASSERT(__dist >= 0, "invalid range in span's constructor (iterator, sentinel)");
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(__dist >= 0, "invalid range in span's constructor (iterator, sentinel)");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__dist == _Extent, "invalid range in span's constructor (iterator, sentinel): last - first != extent");
}
template <__span_compatible_range<element_type> _Range>
_LIBCPP_INLINE_VISIBILITY
constexpr explicit span(_Range&& __r) : __data_{ranges::data(__r)} {
- _LIBCPP_ASSERT(ranges::size(__r) == _Extent, "size mismatch in span's constructor (range)");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ranges::size(__r) == _Extent, "size mismatch in span's constructor (range)");
}
template <__span_array_convertible<element_type> _OtherElementType>
template <__span_array_convertible<element_type> _OtherElementType>
_LIBCPP_INLINE_VISIBILITY
constexpr explicit span(const span<_OtherElementType, dynamic_extent>& __other) noexcept
- : __data_{__other.data()} { _LIBCPP_ASSERT(_Extent == __other.size(), "size mismatch in span's constructor (other span)"); }
+ : __data_{__other.data()} {
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Extent == __other.size(), "size mismatch in span's constructor (other span)");
+ }
// ~span() noexcept = default;
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, dynamic_extent> first(size_type __count) const noexcept
{
- _LIBCPP_ASSERT(__count <= size(), "span<T, N>::first(count): count out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count <= size(), "span<T, N>::first(count): count out of range");
return {data(), __count};
}
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, dynamic_extent> last(size_type __count) const noexcept
{
- _LIBCPP_ASSERT(__count <= size(), "span<T, N>::last(count): count out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count <= size(), "span<T, N>::last(count): count out of range");
return {data() + size() - __count, __count};
}
constexpr span<element_type, dynamic_extent>
subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept
{
- _LIBCPP_ASSERT(__offset <= size(), "span<T, N>::subspan(offset, count): offset out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__offset <= size(), "span<T, N>::subspan(offset, count): offset out of range");
if (__count == dynamic_extent)
return {data() + __offset, size() - __offset};
- _LIBCPP_ASSERT(__count <= size() - __offset, "span<T, N>::subspan(offset, count): offset + count out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count <= size() - __offset,
+ "span<T, N>::subspan(offset, count): offset + count out of range");
return {data() + __offset, __count};
}
_LIBCPP_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept
{
- _LIBCPP_ASSERT(__idx < size(), "span<T, N>::operator[](index): index out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__idx < size(), "span<T, N>::operator[](index): index out of range");
return __data_[__idx];
}
_LIBCPP_INLINE_VISIBILITY constexpr reference front() const noexcept
{
- _LIBCPP_ASSERT(!empty(), "span<T, N>::front() on empty span");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "span<T, N>::front() on empty span");
return __data_[0];
}
_LIBCPP_INLINE_VISIBILITY constexpr reference back() const noexcept
{
- _LIBCPP_ASSERT(!empty(), "span<T, N>::back() on empty span");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "span<T, N>::back() on empty span");
return __data_[size()-1];
}
template <__span_compatible_iterator<element_type> _It, __span_compatible_sentinel_for<_It> _End>
_LIBCPP_INLINE_VISIBILITY constexpr span(_It __first, _End __last)
: __data_(_VSTD::to_address(__first)), __size_(__last - __first) {
- _LIBCPP_ASSERT(__last - __first >= 0, "invalid range in span's constructor (iterator, sentinel)");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__last - __first >= 0, "invalid range in span's constructor (iterator, sentinel)");
}
template <size_t _Sz>
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, _Count> first() const noexcept
{
- _LIBCPP_ASSERT(_Count <= size(), "span<T>::first<Count>(): Count out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Count <= size(), "span<T>::first<Count>(): Count out of range");
return span<element_type, _Count>{data(), _Count};
}
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, _Count> last() const noexcept
{
- _LIBCPP_ASSERT(_Count <= size(), "span<T>::last<Count>(): Count out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Count <= size(), "span<T>::last<Count>(): Count out of range");
return span<element_type, _Count>{data() + size() - _Count, _Count};
}
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, dynamic_extent> first(size_type __count) const noexcept
{
- _LIBCPP_ASSERT(__count <= size(), "span<T>::first(count): count out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count <= size(), "span<T>::first(count): count out of range");
return {data(), __count};
}
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, dynamic_extent> last (size_type __count) const noexcept
{
- _LIBCPP_ASSERT(__count <= size(), "span<T>::last(count): count out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count <= size(), "span<T>::last(count): count out of range");
return {data() + size() - __count, __count};
}
_LIBCPP_INLINE_VISIBILITY
constexpr span<element_type, _Count> subspan() const noexcept
{
- _LIBCPP_ASSERT(_Offset <= size(), "span<T>::subspan<Offset, Count>(): Offset out of range");
- _LIBCPP_ASSERT(_Count == dynamic_extent || _Count <= size() - _Offset, "span<T>::subspan<Offset, Count>(): Offset + Count out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Offset <= size(), "span<T>::subspan<Offset, Count>(): Offset out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Count == dynamic_extent || _Count <= size() - _Offset,
+ "span<T>::subspan<Offset, Count>(): Offset + Count out of range");
return span<element_type, _Count>{data() + _Offset, _Count == dynamic_extent ? size() - _Offset : _Count};
}
_LIBCPP_INLINE_VISIBILITY
subspan(size_type __offset, size_type __count = dynamic_extent) const noexcept
{
- _LIBCPP_ASSERT(__offset <= size(), "span<T>::subspan(offset, count): offset out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__offset <= size(), "span<T>::subspan(offset, count): offset out of range");
if (__count == dynamic_extent)
return {data() + __offset, size() - __offset};
- _LIBCPP_ASSERT(__count <= size() - __offset, "span<T>::subspan(offset, count): offset + count out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__count <= size() - __offset,
+ "span<T>::subspan(offset, count): offset + count out of range");
return {data() + __offset, __count};
}
_LIBCPP_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept
{
- _LIBCPP_ASSERT(__idx < size(), "span<T>::operator[](index): index out of range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__idx < size(), "span<T>::operator[](index): index out of range");
return __data_[__idx];
}
_LIBCPP_INLINE_VISIBILITY constexpr reference front() const noexcept
{
- _LIBCPP_ASSERT(!empty(), "span<T>::front() on empty span");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "span<T>::front() on empty span");
return __data_[0];
}
_LIBCPP_INLINE_VISIBILITY constexpr reference back() const noexcept
{
- _LIBCPP_ASSERT(!empty(), "span<T>::back() on empty span");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "span<T>::back() on empty span");
return __data_[size()-1];
}
template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s)
: __r_(__default_init_tag(), __default_init_tag()) {
- _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*) detected nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "basic_string(const char*) detected nullptr");
__init(__s, traits_type::length(__s));
std::__debug_db_insert_c(this);
}
template <__enable_if_t<__is_allocator<_Allocator>::value, int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, const _Allocator& __a)
: __r_(__default_init_tag(), __a) {
- _LIBCPP_ASSERT(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "basic_string(const char*, allocator) detected nullptr");
__init(__s, traits_type::length(__s));
std::__debug_db_insert_c(this);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 basic_string(const _CharT* __s, size_type __n)
: __r_(__default_init_tag(), __default_init_tag()) {
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "basic_string(const char*, n) detected nullptr");
__init(__s, __n);
std::__debug_db_insert_c(this);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
basic_string(const _CharT* __s, size_type __n, const _Allocator& __a)
: __r_(__default_init_tag(), __a) {
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "basic_string(const char*, n, allocator) detected nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr,
+ "basic_string(const char*, n, allocator) detected nullptr");
__init(__s, __n);
std::__debug_db_insert_c(this);
}
bool empty() const _NOEXCEPT {return size() == 0;}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference operator[](size_type __pos) const _NOEXCEPT {
- _LIBCPP_ASSERT(__pos <= size(), "string index out of bounds");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__pos <= size(), "string index out of bounds");
return *(data() + __pos);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference operator[](size_type __pos) _NOEXCEPT {
- _LIBCPP_ASSERT(__pos <= size(), "string index out of bounds");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__pos <= size(), "string index out of bounds");
return *(__get_pointer() + __pos);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 void pop_back();
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference front() _NOEXCEPT {
- _LIBCPP_ASSERT(!empty(), "string::front(): string is empty");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "string::front(): string is empty");
return *__get_pointer();
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference front() const _NOEXCEPT {
- _LIBCPP_ASSERT(!empty(), "string::front(): string is empty");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "string::front(): string is empty");
return *data();
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 reference back() _NOEXCEPT {
- _LIBCPP_ASSERT(!empty(), "string::back(): string is empty");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "string::back(): string is empty");
return *(__get_pointer() + size() - 1);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 const_reference back() const _NOEXCEPT {
- _LIBCPP_ASSERT(!empty(), "string::back(): string is empty");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "string::back(): string is empty");
return *(data() + size() - 1);
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
void __set_short_size(size_type __s) _NOEXCEPT {
- _LIBCPP_ASSERT(__s < __min_cap, "__s should never be greater than or equal to the short string capacity");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s < __min_cap,
+ "__s should never be greater than or equal to the short string capacity");
__r_.first().__s.__size_ = __s;
__r_.first().__s.__is_long_ = false;
}
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
size_type __get_short_size() const _NOEXCEPT {
- _LIBCPP_ASSERT(!__r_.first().__s.__is_long_, "String has to be short when trying to get the short size");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!__r_.first().__s.__is_long_,
+ "String has to be short when trying to get the short size");
return __r_.first().__s.__size_;
}
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s, size_type __n)
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::assign received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::assign received nullptr");
return (__builtin_constant_p(__n) && __fits_in_sso(__n))
? __assign_short(__s, __n)
: __assign_external(__s, __n);
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::assign(const value_type* __s)
{
- _LIBCPP_ASSERT(__s != nullptr, "string::assign received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::assign received nullptr");
return __builtin_constant_p(*__s)
? (__fits_in_sso(traits_type::length(__s))
? __assign_short(__s, traits_type::length(__s))
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s, size_type __n)
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::append received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::append received nullptr");
size_type __cap = capacity();
size_type __sz = size();
if (__cap - __sz >= __n)
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::append(const value_type* __s)
{
- _LIBCPP_ASSERT(__s != nullptr, "string::append received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::append received nullptr");
return append(__s, traits_type::length(__s));
}
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_type* __s, size_type __n)
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::insert received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::insert received nullptr");
size_type __sz = size();
if (__pos > __sz)
__throw_out_of_range();
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::insert(size_type __pos, const value_type* __s)
{
- _LIBCPP_ASSERT(__s != nullptr, "string::insert received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::insert received nullptr");
return insert(__pos, __s, traits_type::length(__s));
}
basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __n1, const value_type* __s, size_type __n2)
_LIBCPP_DISABLE_UBSAN_UNSIGNED_INTEGER_CHECK
{
- _LIBCPP_ASSERT(__n2 == 0 || __s != nullptr, "string::replace received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n2 == 0 || __s != nullptr, "string::replace received nullptr");
size_type __sz = size();
if (__pos > __sz)
__throw_out_of_range();
basic_string<_CharT, _Traits, _Allocator>&
basic_string<_CharT, _Traits, _Allocator>::replace(size_type __pos, size_type __n1, const value_type* __s)
{
- _LIBCPP_ASSERT(__s != nullptr, "string::replace received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::replace received nullptr");
return replace(__pos, __n1, __s, traits_type::length(__s));
}
"string::erase(iterator) called with an iterator not"
" referring to this string");
- _LIBCPP_ASSERT(__pos != end(), "string::erase(iterator) called with a non-dereferenceable iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__pos != end(), "string::erase(iterator) called with a non-dereferenceable iterator");
iterator __b = begin();
size_type __r = static_cast<size_type>(__pos - __b);
erase(__r, 1);
"string::erase(iterator, iterator) called with an iterator not"
" referring to this string");
- _LIBCPP_ASSERT(__first <= __last, "string::erase(first, last) called with invalid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "string::erase(first, last) called with invalid range");
iterator __b = begin();
size_type __r = static_cast<size_type>(__first - __b);
erase(__r, static_cast<size_type>(__last - __first));
void
basic_string<_CharT, _Traits, _Allocator>::pop_back()
{
- _LIBCPP_ASSERT(!empty(), "string::pop_back(): string is already empty");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "string::pop_back(): string is already empty");
__erase_to_end(size() - 1);
}
std::__debug_db_invalidate_all(&__str);
std::__debug_db_swap(this, &__str);
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
__alloc_traits::propagate_on_container_swap::value ||
__alloc_traits::is_always_equal::value ||
__alloc() == __str.__alloc(), "swapping non-equal allocators");
size_type __pos,
size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::find(): received nullptr");
return std::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
basic_string<_CharT, _Traits, _Allocator>::find(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::find(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::find(): received nullptr");
return std::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
size_type __pos,
size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::rfind(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::rfind(): received nullptr");
return std::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
basic_string<_CharT, _Traits, _Allocator>::rfind(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::rfind(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::rfind(): received nullptr");
return std::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
size_type __pos,
size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_first_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::find_first_of(): received nullptr");
return std::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
basic_string<_CharT, _Traits, _Allocator>::find_first_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::find_first_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::find_first_of(): received nullptr");
return std::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
size_type __pos,
size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_last_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::find_last_of(): received nullptr");
return std::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
basic_string<_CharT, _Traits, _Allocator>::find_last_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::find_last_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::find_last_of(): received nullptr");
return std::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
size_type __pos,
size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_first_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::find_first_not_of(): received nullptr");
return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
basic_string<_CharT, _Traits, _Allocator>::find_first_not_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::find_first_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::find_first_not_of(): received nullptr");
return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
size_type __pos,
size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string::find_last_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string::find_last_not_of(): received nullptr");
return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
basic_string<_CharT, _Traits, _Allocator>::find_last_not_of(const value_type* __s,
size_type __pos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::find_last_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::find_last_not_of(): received nullptr");
return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
const value_type* __s,
size_type __n2) const
{
- _LIBCPP_ASSERT(__n2 == 0 || __s != nullptr, "string::compare(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n2 == 0 || __s != nullptr, "string::compare(): received nullptr");
size_type __sz = size();
if (__pos1 > __sz || __n2 == npos)
__throw_out_of_range();
int
basic_string<_CharT, _Traits, _Allocator>::compare(const value_type* __s) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string::compare(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::compare(): received nullptr");
return compare(0, npos, __s, traits_type::length(__s));
}
size_type __n1,
const value_type* __s) const
{
- _LIBCPP_ASSERT(__s != nullptr, "string::compare(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string::compare(): received nullptr");
return compare(__pos1, __n1, __s, traits_type::length(__s));
}
const basic_string<_CharT, _Traits, _Allocator>& __rhs) _NOEXCEPT
{
typedef basic_string<_CharT, _Traits, _Allocator> _String;
- _LIBCPP_ASSERT(__lhs != nullptr, "operator==(char*, basic_string): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__lhs != nullptr, "operator==(char*, basic_string): received nullptr");
size_t __lhs_len = _Traits::length(__lhs);
if (__lhs_len != __rhs.size()) return false;
return __rhs.compare(0, _String::npos, __lhs, __lhs_len) == 0;
return basic_string_view<_CharT, _Traits>(__lhs) == basic_string_view<_CharT, _Traits>(__rhs);
#else
typedef basic_string<_CharT, _Traits, _Allocator> _String;
- _LIBCPP_ASSERT(__rhs != nullptr, "operator==(basic_string, char*): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__rhs != nullptr, "operator==(basic_string, char*): received nullptr");
size_t __rhs_len = _Traits::length(__rhs);
if (__rhs_len != __lhs.size()) return false;
return __lhs.compare(0, _String::npos, __rhs, __rhs_len) == 0;
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
inline size_t __char_traits_length_checked(const typename _Traits::char_type* __s) _NOEXCEPT {
// This needs to be a single statement for C++11 constexpr
- return _LIBCPP_ASSERT(__s != nullptr, "null pointer passed to non-null argument of char_traits<...>::length"), _Traits::length(__s);
+ return _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr,
+ "null pointer passed to non-null argument of char_traits<...>::length"),
+ _Traits::length(__s);
}
template<class _CharT, class _Traits>
: __data_(__s), __size_(__len)
{
#if _LIBCPP_STD_VER >= 14
- _LIBCPP_ASSERT(__len <= static_cast<size_type>(numeric_limits<difference_type>::max()), "string_view::string_view(_CharT *, size_t): length does not fit in difference_type");
- _LIBCPP_ASSERT(__len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __len <= static_cast<size_type>(numeric_limits<difference_type>::max()),
+ "string_view::string_view(_CharT *, size_t): length does not fit in difference_type");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__len == 0 || __s != nullptr,
+ "string_view::string_view(_CharT *, size_t): received nullptr");
#endif
}
constexpr _LIBCPP_HIDE_FROM_ABI basic_string_view(_It __begin, _End __end)
: __data_(_VSTD::to_address(__begin)), __size_(__end - __begin)
{
- _LIBCPP_ASSERT((__end - __begin) >= 0, "std::string_view::string_view(iterator, sentinel) received invalid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED((__end - __begin) >= 0,
+ "std::string_view::string_view(iterator, sentinel) received invalid range");
}
#endif // _LIBCPP_STD_VER >= 20
// [string.view.access], element access
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
const_reference operator[](size_type __pos) const _NOEXCEPT {
- return _LIBCPP_ASSERT(__pos < size(), "string_view[] index out of bounds"), __data_[__pos];
+ return _LIBCPP_ASSERT_UNCATEGORIZED(__pos < size(), "string_view[] index out of bounds"), __data_[__pos];
}
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
const_reference front() const _NOEXCEPT
{
- return _LIBCPP_ASSERT(!empty(), "string_view::front(): string is empty"), __data_[0];
+ return _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "string_view::front(): string is empty"), __data_[0];
}
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
const_reference back() const _NOEXCEPT
{
- return _LIBCPP_ASSERT(!empty(), "string_view::back(): string is empty"), __data_[__size_-1];
+ return _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "string_view::back(): string is empty"), __data_[__size_-1];
}
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
void remove_prefix(size_type __n) _NOEXCEPT
{
- _LIBCPP_ASSERT(__n <= size(), "remove_prefix() can't remove more than size()");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n <= size(), "remove_prefix() can't remove more than size()");
__data_ += __n;
__size_ -= __n;
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
void remove_suffix(size_type __n) _NOEXCEPT
{
- _LIBCPP_ASSERT(__n <= size(), "remove_suffix() can't remove more than size()");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n <= size(), "remove_suffix() can't remove more than size()");
__size_ -= __n;
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
return std::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string_view::find(): received nullptr");
return std::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find(const _CharT* __s, size_type __pos = 0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string_view::find(): received nullptr");
return std::__str_find<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type rfind(basic_string_view __s, size_type __pos = npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s.size() == 0 || __s.data() != nullptr, "string_view::find(): received nullptr");
return std::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type rfind(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::rfind(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string_view::rfind(): received nullptr");
return std::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type rfind(const _CharT* __s, size_type __pos=npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::rfind(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string_view::rfind(): received nullptr");
return std::__str_rfind<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_first_of(basic_string_view __s, size_type __pos = 0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s.size() == 0 || __s.data() != nullptr,
+ "string_view::find_first_of(): received nullptr");
return std::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_first_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string_view::find_first_of(): received nullptr");
return std::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_first_of(const _CharT* __s, size_type __pos=0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string_view::find_first_of(): received nullptr");
return std::__str_find_first_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_last_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s.size() == 0 || __s.data() != nullptr,
+ "string_view::find_last_of(): received nullptr");
return std::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_last_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string_view::find_last_of(): received nullptr");
return std::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_last_of(const _CharT* __s, size_type __pos=npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string_view::find_last_of(): received nullptr");
return std::__str_find_last_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(basic_string_view __s, size_type __pos=0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_first_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s.size() == 0 || __s.data() != nullptr,
+ "string_view::find_first_not_of(): received nullptr");
return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string_view::find_first_not_of(): received nullptr");
return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_first_not_of(const _CharT* __s, size_type __pos=0) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find_first_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string_view::find_first_not_of(): received nullptr");
return std::__str_find_first_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(basic_string_view __s, size_type __pos=npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s.size() == 0 || __s.data() != nullptr, "string_view::find_last_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s.size() == 0 || __s.data() != nullptr,
+ "string_view::find_last_not_of(): received nullptr");
return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s.data(), __pos, __s.size());
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n == 0 || __s != nullptr, "string_view::find_last_not_of(): received nullptr");
return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, __n);
}
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
size_type find_last_not_of(const _CharT* __s, size_type __pos=npos) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__s != nullptr, "string_view::find_last_not_of(): received nullptr");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__s != nullptr, "string_view::find_last_not_of(): received nullptr");
return std::__str_find_last_not_of<value_type, size_type, traits_type, npos>
(data(), size(), __s, __pos, traits_type::length(__s));
}
_LIBCPP_INLINE_VISIBILITY
insert_return_type insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_map::insert()");
return __table_.template __node_handle_insert_unique<
node_type, insert_return_type>(_VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_map::insert()");
return __table_.template __node_handle_insert_unique<node_type>(
__hint.__i_, _VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_map<key_type, mapped_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_unique(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_map<key_type, mapped_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_unique(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multimap<key_type, mapped_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_unique(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multimap<key_type, mapped_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_unique(__source.__table_);
}
#endif
_LIBCPP_INLINE_VISIBILITY
iterator insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_multimap::insert()");
return __table_.template __node_handle_insert_multi<node_type>(
_VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_multimap::insert()");
return __table_.template __node_handle_insert_multi<node_type>(
__hint.__i_, _VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multimap<key_type, mapped_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multimap<key_type, mapped_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_map<key_type, mapped_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_map<key_type, mapped_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
#endif
_LIBCPP_INLINE_VISIBILITY
insert_return_type insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_set::insert()");
return __table_.template __node_handle_insert_unique<
node_type, insert_return_type>(_VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __h, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_set::insert()");
return __table_.template __node_handle_insert_unique<node_type>(
__h, _VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_set<key_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__table_.__node_handle_merge_unique(__source.__table_);
}
template<class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_set<key_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__table_.__node_handle_merge_unique(__source.__table_);
}
template<class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__table_.__node_handle_merge_unique(__source.__table_);
}
template<class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
__table_.__node_handle_merge_unique(__source.__table_);
}
#endif
_LIBCPP_INLINE_VISIBILITY
iterator insert(node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_multiset::insert()");
return __table_.template __node_handle_insert_multi<node_type>(
_VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
iterator insert(const_iterator __hint, node_type&& __nh)
{
- _LIBCPP_ASSERT(__nh.empty() || __nh.get_allocator() == get_allocator(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__nh.empty() || __nh.get_allocator() == get_allocator(),
"node_type with incompatible allocator passed to unordered_multiset::insert()");
return __table_.template __node_handle_insert_multi<node_type>(
__hint, _VSTD::move(__nh));
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_multiset<key_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_set<key_type, _H2, _P2, allocator_type>& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
template <class _H2, class _P2>
_LIBCPP_INLINE_VISIBILITY
void merge(unordered_set<key_type, _H2, _P2, allocator_type>&& __source)
{
- _LIBCPP_ASSERT(__source.get_allocator() == get_allocator(),
- "merging container with incompatible allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__source.get_allocator() == get_allocator(),
+ "merging container with incompatible allocator");
return __table_.__node_handle_merge_multi(__source.__table_);
}
#endif
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference front() _NOEXCEPT
{
- _LIBCPP_ASSERT(!empty(), "front() called on an empty vector");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "front() called on an empty vector");
return *this->__begin_;
}
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference front() const _NOEXCEPT
{
- _LIBCPP_ASSERT(!empty(), "front() called on an empty vector");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "front() called on an empty vector");
return *this->__begin_;
}
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI reference back() _NOEXCEPT
{
- _LIBCPP_ASSERT(!empty(), "back() called on an empty vector");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "back() called on an empty vector");
return *(this->__end_ - 1);
}
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI const_reference back() const _NOEXCEPT
{
- _LIBCPP_ASSERT(!empty(), "back() called on an empty vector");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "back() called on an empty vector");
return *(this->__end_ - 1);
}
typename vector<_Tp, _Allocator>::reference
vector<_Tp, _Allocator>::operator[](size_type __n) _NOEXCEPT
{
- _LIBCPP_ASSERT(__n < size(), "vector[] index out of bounds");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n < size(), "vector[] index out of bounds");
return this->__begin_[__n];
}
typename vector<_Tp, _Allocator>::const_reference
vector<_Tp, _Allocator>::operator[](size_type __n) const _NOEXCEPT
{
- _LIBCPP_ASSERT(__n < size(), "vector[] index out of bounds");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n < size(), "vector[] index out of bounds");
return this->__begin_[__n];
}
void
vector<_Tp, _Allocator>::pop_back()
{
- _LIBCPP_ASSERT(!empty(), "vector::pop_back called on an empty vector");
+ _LIBCPP_ASSERT_UNCATEGORIZED(!empty(), "vector::pop_back called on an empty vector");
this->__destruct_at_end(this->__end_ - 1);
}
{
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__position)) == this,
"vector::erase(iterator) called with an iterator not referring to this vector");
- _LIBCPP_ASSERT(__position != end(),
+ _LIBCPP_ASSERT_UNCATEGORIZED(__position != end(),
"vector::erase(iterator) called with a non-dereferenceable iterator");
difference_type __ps = __position - cbegin();
pointer __p = this->__begin_ + __ps;
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__find_c_from_i(std::addressof(__last)) == this,
"vector::erase(iterator, iterator) called with an iterator not referring to this vector");
- _LIBCPP_ASSERT(__first <= __last, "vector::erase(first, last) called with invalid range");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first <= __last, "vector::erase(first, last) called with invalid range");
pointer __p = this->__begin_ + (__first - begin());
if (__first != __last) {
this->__destruct_at_end(std::move(__p + (__last - __first), this->__end_, __p));
__is_nothrow_swappable<allocator_type>::value)
#endif
{
- _LIBCPP_ASSERT(__alloc_traits::propagate_on_container_swap::value ||
- this->__alloc() == __x.__alloc(),
- "vector::swap: Either propagate_on_container_swap must be true"
- " or the allocators must compare equal");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__alloc_traits::propagate_on_container_swap::value ||
+ this->__alloc() == __x.__alloc(),
+ "vector::swap: Either propagate_on_container_swap must be true"
+ " or the allocators must compare equal");
std::swap(this->__begin_, __x.__begin_);
std::swap(this->__end_, __x.__end_);
std::swap(this->__end_cap(), __x.__end_cap());
template <class _ForwardIterator, class _Sentinel>
_LIBCPP_CONSTEXPR_SINCE_CXX20 _LIBCPP_HIDE_FROM_ABI
void vector<bool, _Allocator>::__assign_with_size(_ForwardIterator __first, _Sentinel __last, difference_type __ns) {
- _LIBCPP_ASSERT(__ns >= 0, "invalid range specified");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__ns >= 0, "invalid range specified");
clear();
typename vector<bool, _Allocator>::iterator
vector<bool, _Allocator>::__insert_with_size(const_iterator __position, _ForwardIterator __first, _Sentinel __last,
difference_type __n_signed) {
- _LIBCPP_ASSERT(__n_signed >= 0, "invalid range specified");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__n_signed >= 0, "invalid range specified");
const size_type __n = static_cast<size_type>(__n_signed);
iterator __r;
size_type __c = capacity();
}
directory_iterator& directory_iterator::__increment(error_code* ec) {
- _LIBCPP_ASSERT(__imp_, "Attempting to increment an invalid iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__imp_, "Attempting to increment an invalid iterator");
ErrorHandler<void> err("directory_iterator::operator++()", ec);
error_code m_ec;
}
directory_entry const& directory_iterator::__dereference() const {
- _LIBCPP_ASSERT(__imp_, "Attempting to dereference an invalid iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__imp_, "Attempting to dereference an invalid iterator");
return __imp_->__entry_;
}
}
void recursive_directory_iterator::__pop(error_code* ec) {
- _LIBCPP_ASSERT(__imp_, "Popping the end iterator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__imp_, "Popping the end iterator");
if (ec)
ec->clear();
__imp_->__stack_.pop();
#endif // _LIBCPP_WIN32API
inline error_code capture_errno() {
- _LIBCPP_ASSERT(errno != 0, "Expected errno to be non-zero");
+ _LIBCPP_ASSERT_UNCATEGORIZED(errno != 0, "Expected errno to be non-zero");
return error_code(errno, generic_category());
}
size_t size_with_null = static_cast<size_t>(ret) + 1;
result.__resize_default_init(size_with_null - 1);
ret = ::vsnprintf(&result[0], size_with_null, msg, ap);
- _LIBCPP_ASSERT(static_cast<size_t>(ret) == (size_with_null - 1), "TODO");
+ _LIBCPP_ASSERT_UNCATEGORIZED(static_cast<size_t>(ret) == (size_with_null - 1), "TODO");
}
return result;
}
Deleter deleter = &::free;
#else
auto size = ::pathconf(".", _PC_PATH_MAX);
- _LIBCPP_ASSERT(size >= 0, "pathconf returned a 0 as max size");
+ _LIBCPP_ASSERT_UNCATEGORIZED(size >= 0, "pathconf returned a 0 as max size");
auto buff = unique_ptr<path::value_type[]>(new path::value_type[size + 1]);
path::value_type* ptr = buff.get();
const bool resolve_symlinks = !has_opt(perm_options::nofollow);
const bool add_perms = has_opt(perm_options::add);
const bool remove_perms = has_opt(perm_options::remove);
- _LIBCPP_ASSERT(
+ _LIBCPP_ASSERT_UNCATEGORIZED(
(add_perms + remove_perms + has_opt(perm_options::replace)) == 1,
"One and only one of the perm_options constants replace, add, or remove "
"is present in opts");
set_sym_perms = is_symlink(st);
if (m_ec)
return err.report(m_ec);
- _LIBCPP_ASSERT(st.permissions() != perms::unknown,
+ _LIBCPP_ASSERT_UNCATEGORIZED(st.permissions() != perms::unknown,
"Permissions unexpectedly unknown");
if (add_perms)
prms |= st.permissions();
detail::SSizeT ret;
if ((ret = detail::readlink(p.c_str(), buff.get(), size)) == -1)
return err.report(capture_errno());
- _LIBCPP_ASSERT(ret > 0, "TODO");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ret > 0, "TODO");
if (static_cast<size_t>(ret) >= size)
return err.report(errc::value_too_large);
buff[ret] = 0;
inline wchar_t *realpath(const wchar_t *path, wchar_t *resolved_name) {
// Only expected to be used with us allocating the buffer.
- _LIBCPP_ASSERT(resolved_name == nullptr,
+ _LIBCPP_ASSERT_UNCATEGORIZED(resolved_name == nullptr,
"Windows realpath() assumes a null resolved_name");
WinHandle h(path, FILE_READ_ATTRIBUTES, 0);
// Function precondition: __v is not a 10-digit number.
// (f2s: 9 digits are sufficient for round-tripping.)
// (d2fixed: We print 9-digit blocks.)
- _LIBCPP_ASSERT(__v < 1000000000, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__v < 1000000000, "");
if (__v >= 100000000) { return 9; }
if (__v >= 10000000) { return 8; }
if (__v >= 1000000) { return 7; }
// This approximation works up to the point that the multiplication overflows at __e = 3529.
// If the multiplication were done in 64 bits, it would fail at 5^4004 which is just greater
// than 2^9297.
- _LIBCPP_ASSERT(__e >= 0, "");
- _LIBCPP_ASSERT(__e <= 3528, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__e >= 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__e <= 3528, "");
return static_cast<int32_t>(((static_cast<uint32_t>(__e) * 1217359) >> 19) + 1);
}
// Returns floor(log_10(2^__e)).
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __log10Pow2(const int32_t __e) {
// The first value this approximation fails for is 2^1651 which is just greater than 10^297.
- _LIBCPP_ASSERT(__e >= 0, "");
- _LIBCPP_ASSERT(__e <= 1650, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__e >= 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__e <= 1650, "");
return (static_cast<uint32_t>(__e) * 78913) >> 18;
}
// Returns floor(log_10(5^__e)).
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __log10Pow5(const int32_t __e) {
// The first value this approximation fails for is 5^2621 which is just greater than 10^1832.
- _LIBCPP_ASSERT(__e >= 0, "");
- _LIBCPP_ASSERT(__e <= 2620, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__e >= 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__e <= 2620, "");
return (static_cast<uint32_t>(__e) * 732923) >> 20;
}
// (The shift value is in the range [49, 58].)
// Check this here in case a future change requires larger shift
// values. In this case this function needs to be adjusted.
- _LIBCPP_ASSERT(__dist < 64, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__dist < 64, "");
return __shiftright128(__lo, __hi, static_cast<unsigned char>(__dist));
}
// (The shift value is in the range [49, 58].)
// Check this here in case a future change requires larger shift
// values. In this case this function needs to be adjusted.
- _LIBCPP_ASSERT(__dist < 64, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__dist < 64, "");
auto __temp = __lo | ((unsigned __int128)__hi << 64);
// For x64 128-bit shfits using the `shrd` instruction and two 64-bit
// registers, the shift value is modulo 64. Thus the `& 63` is free.
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint64_t __ryu_shiftright128(const uint64_t __lo, const uint64_t __hi, const uint32_t __dist) {
// We don't need to handle the case __dist >= 64 here (see above).
- _LIBCPP_ASSERT(__dist < 64, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__dist < 64, "");
#ifdef _LIBCPP_64_BIT
- _LIBCPP_ASSERT(__dist > 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__dist > 0, "");
return (__hi << (64 - __dist)) | (__lo >> __dist);
#else // ^^^ 64-bit ^^^ / vvv 32-bit vvv
// Avoid a 64-bit shift by taking advantage of the range of shift values.
- _LIBCPP_ASSERT(__dist >= 32, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__dist >= 32, "");
return (__hi << (64 - __dist)) | (static_cast<uint32_t>(__lo >> 32) >> (__dist - 32));
#endif // ^^^ 32-bit ^^^
}
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __pow5Factor(uint64_t __value) {
uint32_t __count = 0;
for (;;) {
- _LIBCPP_ASSERT(__value != 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__value != 0, "");
const uint64_t __q = __div5(__value);
const uint32_t __r = static_cast<uint32_t>(__value) - 5 * static_cast<uint32_t>(__q);
if (__r != 0) {
// Returns true if __value is divisible by 2^__p.
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline bool __multipleOfPowerOf2(const uint64_t __value, const uint32_t __p) {
- _LIBCPP_ASSERT(__value != 0, "");
- _LIBCPP_ASSERT(__p < 64, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__value != 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__p < 64, "");
// __builtin_ctzll doesn't appear to be faster here.
return (__value & ((1ull << __p) - 1)) == 0;
}
// * Print the leading hexit, then mask it away.
{
const uint32_t _Nibble = static_cast<uint32_t>(_Adjusted_mantissa >> _Adjusted_explicit_bits);
- _LIBCPP_ASSERT(_Nibble < 3, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Nibble < 3, "");
const char _Leading_hexit = static_cast<char>('0' + _Nibble);
*_First++ = _Leading_hexit;
int32_t _Number_of_bits_remaining = _Adjusted_explicit_bits; // 24 for float, 52 for double
for (;;) {
- _LIBCPP_ASSERT(_Number_of_bits_remaining >= 4, "");
- _LIBCPP_ASSERT(_Number_of_bits_remaining % 4 == 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Number_of_bits_remaining >= 4, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Number_of_bits_remaining % 4 == 0, "");
_Number_of_bits_remaining -= 4;
const uint32_t _Nibble = static_cast<uint32_t>(_Adjusted_mantissa >> _Number_of_bits_remaining);
- _LIBCPP_ASSERT(_Nibble < 16, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Nibble < 16, "");
const char _Hexit = __itoa::_Charconv_digits[_Nibble];
*_First++ = _Hexit;
// '0' hexits, the same condition works (as we print the final hexit and mask it away); we don't need to test
// _Number_of_bits_remaining.
do {
- _LIBCPP_ASSERT(_Number_of_bits_remaining >= 4, "");
- _LIBCPP_ASSERT(_Number_of_bits_remaining % 4 == 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Number_of_bits_remaining >= 4, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Number_of_bits_remaining % 4 == 0, "");
_Number_of_bits_remaining -= 4;
const uint32_t _Nibble = static_cast<uint32_t>(_Adjusted_mantissa >> _Number_of_bits_remaining);
- _LIBCPP_ASSERT(_Nibble < 16, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Nibble < 16, "");
const char _Hexit = __itoa::_Charconv_digits[_Nibble];
if (_First == _Last) {
_Effective_precision = _VSTD::min(_Precision - (_Scientific_exponent_X + 1), _Max_fixed_precision);
const to_chars_result _Buf_result =
_Floating_to_chars_fixed_precision(_Buffer, _VSTD::end(_Buffer), _Value, _Effective_precision);
- _LIBCPP_ASSERT(_Buf_result.ec == errc{}, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Buf_result.ec == errc{}, "");
_Significand_last = _Buf_result.ptr;
} else {
_Effective_precision = _VSTD::min(_Precision - 1, _Max_scientific_precision);
const to_chars_result _Buf_result =
_Floating_to_chars_scientific_precision(_Buffer, _VSTD::end(_Buffer), _Value, _Effective_precision);
- _LIBCPP_ASSERT(_Buf_result.ec == errc{}, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Buf_result.ec == errc{}, "");
_Significand_last = _VSTD::find(_Buffer, _Buf_result.ptr, 'e');
_Exponent_first = _Significand_last;
_Exponent_last = _Buf_result.ptr;
char* _First, char* const _Last, _Floating _Value, const chars_format _Fmt, const int _Precision) noexcept {
if constexpr (_Overload == _Floating_to_chars_overload::_Plain) {
- _LIBCPP_ASSERT(_Fmt == chars_format{}, ""); // plain overload must pass chars_format{} internally
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Fmt == chars_format{}, ""); // plain overload must pass chars_format{} internally
} else {
- _LIBCPP_ASSERT(_Fmt == chars_format::general || _Fmt == chars_format::scientific || _Fmt == chars_format::fixed
- || _Fmt == chars_format::hex,
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Fmt == chars_format::general || _Fmt == chars_format::scientific
+ || _Fmt == chars_format::fixed || _Fmt == chars_format::hex,
"invalid format in to_chars()");
}
void unsynchronized_pool_resource::__adhoc_pool::__do_deallocate(
memory_resource* upstream, void* p, size_t bytes, size_t align) {
- _LIBCPP_ASSERT(__first_ != nullptr, "deallocating a block that was not allocated with this allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__first_ != nullptr, "deallocating a block that was not allocated with this allocator");
if (__first_->__start_ == p) {
__chunk_footer* next = __first_->__next_;
upstream->deallocate(p, __first_->__allocation_size(), __first_->__align_);
return;
}
}
- _LIBCPP_ASSERT(false, "deallocating a block that was not allocated with this allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(false, "deallocating a block that was not allocated with this allocator");
}
}
}
void* __allocate_in_new_chunk(memory_resource* upstream, size_t block_size, size_t chunk_size) {
- _LIBCPP_ASSERT(chunk_size % block_size == 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(chunk_size % block_size == 0, "");
static_assert(__default_alignment >= alignof(std::max_align_t), "");
static_assert(__default_alignment >= alignof(__chunk_footer), "");
static_assert(__default_alignment >= alignof(__vacancy_header), "");
if (i == __num_fixed_pools_)
return __adhoc_pool_.__do_deallocate(__res_, p, bytes, align);
else {
- _LIBCPP_ASSERT(__fixed_pools_ != nullptr, "deallocating a block that was not allocated with this allocator");
+ _LIBCPP_ASSERT_UNCATEGORIZED(
+ __fixed_pools_ != nullptr, "deallocating a block that was not allocated with this allocator");
__fixed_pools_[i].__evacuate(p);
}
}
{
int ec = __libcpp_mutex_unlock(&__m_);
(void)ec;
- _LIBCPP_ASSERT(ec == 0, "call to mutex::unlock failed");
+ _LIBCPP_ASSERT_UNCATEGORIZED(ec == 0, "call to mutex::unlock failed");
}
// recursive_mutex
{
int e = __libcpp_recursive_mutex_destroy(&__m_);
(void)e;
- _LIBCPP_ASSERT(e == 0, "call to ~recursive_mutex() failed");
+ _LIBCPP_ASSERT_UNCATEGORIZED(e == 0, "call to ~recursive_mutex() failed");
}
void
{
int e = __libcpp_recursive_mutex_unlock(&__m_);
(void)e;
- _LIBCPP_ASSERT(e == 0, "call to recursive_mutex::unlock() failed");
+ _LIBCPP_ASSERT_UNCATEGORIZED(e == 0, "call to recursive_mutex::unlock() failed");
}
bool
const uint64_t __s1low = __low2 + __high1 + __c1; // 128
const uint32_t __c2 = __s1low < __low2; // __high1 + __c1 can't overflow, so compare against __low2
const uint64_t __s1high = __high2 + __c2; // 192
- _LIBCPP_ASSERT(__j >= 128, "");
- _LIBCPP_ASSERT(__j <= 180, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__j >= 128, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__j <= 180, "");
#ifdef _LIBCPP_INTRINSIC128
const uint32_t __dist = static_cast<uint32_t>(__j - 128); // __dist: [0, 52]
const uint64_t __shiftedhigh = __s1high >> __dist;
// The average output length is 16.38 digits, so we check high-to-low.
// Function precondition: __v is not an 18, 19, or 20-digit number.
// (17 digits are sufficient for round-tripping.)
- _LIBCPP_ASSERT(__v < 100000000000000000u, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__v < 100000000000000000u, "");
if (__v >= 10000000000000000u) { return 17; }
if (__v >= 1000000000000000u) { return 16; }
if (__v >= 100000000000000u) { return 15; }
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __pow5Factor(uint32_t __value) {
uint32_t __count = 0;
for (;;) {
- _LIBCPP_ASSERT(__value != 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__value != 0, "");
const uint32_t __q = __value / 5;
const uint32_t __r = __value % 5;
if (__r != 0) {
// Returns true if __value is divisible by 2^__p.
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline bool __multipleOfPowerOf2(const uint32_t __value, const uint32_t __p) {
- _LIBCPP_ASSERT(__value != 0, "");
- _LIBCPP_ASSERT(__p < 32, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__value != 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__p < 32, "");
// __builtin_ctz doesn't appear to be faster here.
return (__value & ((1u << __p) - 1)) == 0;
}
[[nodiscard]] _LIBCPP_HIDE_FROM_ABI inline uint32_t __mulShift(const uint32_t __m, const uint64_t __factor, const int32_t __shift) {
- _LIBCPP_ASSERT(__shift > 32, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__shift > 32, "");
// The casts here help MSVC to avoid calls to the __allmul library
// function.
#else // ^^^ 32-bit ^^^ / vvv 64-bit vvv
const uint64_t __sum = (__bits0 >> 32) + __bits1;
const uint64_t __shiftedSum = __sum >> (__shift - 32);
- _LIBCPP_ASSERT(__shiftedSum <= UINT32_MAX, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(__shiftedSum <= UINT32_MAX, "");
return static_cast<uint32_t>(__shiftedSum);
#endif // ^^^ 64-bit ^^^
}
// Performance note: Long division appears to be faster than losslessly widening float to double and calling
// __d2fixed_buffered_n(). If __f2fixed_buffered_n() is implemented, it might be faster than long division.
- _LIBCPP_ASSERT(_Exponent2 > 0, "");
- _LIBCPP_ASSERT(_Exponent2 <= 104, ""); // because __ieeeExponent <= 254
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Exponent2 > 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Exponent2 <= 104, ""); // because __ieeeExponent <= 254
// Manually represent _Mantissa2 * 2^_Exponent2 as a large integer. _Mantissa2 is always 24 bits
// (due to the implicit bit), while _Exponent2 indicates a shift of at most 104 bits.
// _Maxidx is the index of the most significant nonzero element.
uint32_t _Maxidx = ((24 + static_cast<uint32_t>(_Exponent2) + 31) / 32) - 1;
- _LIBCPP_ASSERT(_Maxidx < _Data_size, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Maxidx < _Data_size, "");
const uint32_t _Bit_shift = static_cast<uint32_t>(_Exponent2) % 32;
if (_Bit_shift <= 8) { // _Mantissa2's 24 bits don't cross an element boundary
}
}
- _LIBCPP_ASSERT(_Data[0] != 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Data[0] != 0, "");
for (uint32_t _Idx = 1; _Idx < _Data_size; ++_Idx) {
- _LIBCPP_ASSERT(_Data[_Idx] == 0, "");
+ _LIBCPP_ASSERT_UNCATEGORIZED(_Data[_Idx] == 0, "");
}
const uint32_t _Data_olength = _Data[0] >= 1000000000 ? 10 : __decimalLength9(_Data[0]);
constexpr size_t bufsize = numeric_limits<V>::digits10 + 2; // +1 for minus, +1 for digits10
char buf[bufsize];
const auto res = to_chars(buf, buf + bufsize, v);
- _LIBCPP_ASSERT(res.ec == errc(), "bufsize must be large enough to accomodate the value");
+ _LIBCPP_ASSERT_UNCATEGORIZED(res.ec == errc(), "bufsize must be large enough to accomodate the value");
return S(buf, res.ptr);
}
if (buf == nullptr)
return int_type(EOF);
if (old_size != 0) {
- _LIBCPP_ASSERT(eback(), "overflow copying from NULL");
+ _LIBCPP_ASSERT_UNCATEGORIZED(eback(), "overflow copying from NULL");
memcpy(buf, eback(), static_cast<size_t>(old_size));
}
ptrdiff_t ninp = gptr() - eback();
tokenized.push_back(s);
}
- _LIBCPP_ASSERT(tokenized.size() >= _NCAT, "locale-name list is too short");
+ _LIBCPP_ASSERT_UNCATEGORIZED(tokenized.size() >= _NCAT, "locale-name list is too short");
previous_loc->lc_collate = tokenized[LC_COLLATE];
previous_loc->lc_ctype = tokenized[LC_CTYPE];
if (new_errno == EINVAL)
return "";
- _LIBCPP_ASSERT(new_errno == ERANGE, "unexpected error from ::strerror_r");
+ _LIBCPP_ASSERT_UNCATEGORIZED(new_errno == ERANGE, "unexpected error from ::strerror_r");
// FIXME maybe? 'strerror_buff_size' is likely to exceed the
// maximum error size so ERANGE shouldn't be returned.
std::abort();