mirror of
https://github.com/boostorg/core.git
synced 2025-05-09 23:03:54 +00:00
Rename detail assert macro since it isn't a public facility
This commit is contained in:
parent
cb603c9c6b
commit
b9a2221b3b
@ -5,7 +5,7 @@ Copyright 2025 Glen Joseph Fernandes
|
||||
Distributed under the Boost Software License, Version 1.0.
|
||||
(http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
#undef BOOST_CORE_ASSERT
|
||||
#undef BOOST_CORE_DETAIL_ASSERT
|
||||
|
||||
#include <cassert>
|
||||
|
||||
@ -14,8 +14,8 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
!defined(__INTEL_COMPILER) && \
|
||||
defined(__GNUC__) && \
|
||||
(__GNUC__ < 5)
|
||||
#define BOOST_CORE_ASSERT(expr) \
|
||||
#define BOOST_CORE_DETAIL_ASSERT(expr) \
|
||||
((expr) ? void(0) : __assert_fail(#expr, __FILE__, __LINE__, 0))
|
||||
#else
|
||||
#define BOOST_CORE_ASSERT(expr) assert(expr)
|
||||
#define BOOST_CORE_DETAIL_ASSERT(expr) assert(expr)
|
||||
#endif
|
||||
|
@ -275,18 +275,18 @@ public:
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
constexpr span<T, dynamic_extent> subspan(size_type o,
|
||||
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())),
|
||||
span<T, dynamic_extent>(s_.p + o,
|
||||
c == dynamic_extent ? s_.n - o : c);
|
||||
@ -305,15 +305,15 @@ public:
|
||||
}
|
||||
|
||||
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 {
|
||||
return BOOST_CORE_ASSERT(!empty()), *s_.p;
|
||||
return BOOST_CORE_DETAIL_ASSERT(!empty()), *s_.p;
|
||||
}
|
||||
|
||||
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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user