Rename detail assert macro since it isn't a public facility

This commit is contained in:
Glen Fernandes 2025-01-18 14:14:24 -05:00
parent cb603c9c6b
commit b9a2221b3b
2 changed files with 9 additions and 9 deletions

View File

@ -5,7 +5,7 @@ Copyright 2025 Glen Joseph Fernandes
Distributed under the Boost Software License, Version 1.0. Distributed under the Boost Software License, Version 1.0.
(http://www.boost.org/LICENSE_1_0.txt) (http://www.boost.org/LICENSE_1_0.txt)
*/ */
#undef BOOST_CORE_ASSERT #undef BOOST_CORE_DETAIL_ASSERT
#include <cassert> #include <cassert>
@ -14,8 +14,8 @@ Distributed under the Boost Software License, Version 1.0.
!defined(__INTEL_COMPILER) && \ !defined(__INTEL_COMPILER) && \
defined(__GNUC__) && \ defined(__GNUC__) && \
(__GNUC__ < 5) (__GNUC__ < 5)
#define BOOST_CORE_ASSERT(expr) \ #define BOOST_CORE_DETAIL_ASSERT(expr) \
((expr) ? void(0) : __assert_fail(#expr, __FILE__, __LINE__, 0)) ((expr) ? void(0) : __assert_fail(#expr, __FILE__, __LINE__, 0))
#else #else
#define BOOST_CORE_ASSERT(expr) assert(expr) #define BOOST_CORE_DETAIL_ASSERT(expr) assert(expr)
#endif #endif

View File

@ -275,18 +275,18 @@ public:
} }
constexpr span<T, dynamic_extent> first(size_type c) const { constexpr span<T, dynamic_extent> first(size_type c) const {
return BOOST_CORE_ASSERT(c <= size()), return BOOST_CORE_DETAIL_ASSERT(c <= size()),
span<T, dynamic_extent>(s_.p, c); span<T, dynamic_extent>(s_.p, c);
} }
constexpr span<T, dynamic_extent> last(size_type c) const { constexpr span<T, dynamic_extent> last(size_type c) const {
return BOOST_CORE_ASSERT(c <= size()), return BOOST_CORE_DETAIL_ASSERT(c <= size()),
span<T, dynamic_extent>(s_.p + (s_.n - c), c); span<T, dynamic_extent>(s_.p + (s_.n - c), c);
} }
constexpr span<T, dynamic_extent> subspan(size_type o, constexpr span<T, dynamic_extent> subspan(size_type o,
size_type c = dynamic_extent) const { size_type c = dynamic_extent) const {
return BOOST_CORE_ASSERT(o <= size() && return BOOST_CORE_DETAIL_ASSERT(o <= size() &&
(c == dynamic_extent || c + o <= size())), (c == dynamic_extent || c + o <= size())),
span<T, dynamic_extent>(s_.p + o, span<T, dynamic_extent>(s_.p + o,
c == dynamic_extent ? s_.n - o : c); c == dynamic_extent ? s_.n - o : c);
@ -305,15 +305,15 @@ public:
} }
constexpr reference operator[](size_type i) const { constexpr reference operator[](size_type i) const {
return BOOST_CORE_ASSERT(i < size()), s_.p[i]; return BOOST_CORE_DETAIL_ASSERT(i < size()), s_.p[i];
} }
constexpr reference front() const { constexpr reference front() const {
return BOOST_CORE_ASSERT(!empty()), *s_.p; return BOOST_CORE_DETAIL_ASSERT(!empty()), *s_.p;
} }
constexpr reference back() const { constexpr reference back() const {
return BOOST_CORE_ASSERT(!empty()), s_.p[s_.n - 1]; return BOOST_CORE_DETAIL_ASSERT(!empty()), s_.p[s_.n - 1];
} }
constexpr pointer data() const noexcept { constexpr pointer data() const noexcept {