From b9a2221b3bfdd956a91e32cd5483612ad1b4a4b6 Mon Sep 17 00:00:00 2001 From: Glen Fernandes Date: Sat, 18 Jan 2025 14:14:24 -0500 Subject: [PATCH] Rename detail assert macro since it isn't a public facility --- include/boost/core/detail/assert.hpp | 6 +++--- include/boost/core/span.hpp | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/boost/core/detail/assert.hpp b/include/boost/core/detail/assert.hpp index daf5c4e..d2d16a7 100644 --- a/include/boost/core/detail/assert.hpp +++ b/include/boost/core/detail/assert.hpp @@ -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 @@ -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 diff --git a/include/boost/core/span.hpp b/include/boost/core/span.hpp index 6732368..3a602c2 100644 --- a/include/boost/core/span.hpp +++ b/include/boost/core/span.hpp @@ -275,18 +275,18 @@ public: } constexpr span first(size_type c) const { - return BOOST_CORE_ASSERT(c <= size()), + return BOOST_CORE_DETAIL_ASSERT(c <= size()), span(s_.p, c); } constexpr span last(size_type c) const { - return BOOST_CORE_ASSERT(c <= size()), + return BOOST_CORE_DETAIL_ASSERT(c <= size()), span(s_.p + (s_.n - c), c); } constexpr span 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(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 {