mirror of
https://github.com/boostorg/core.git
synced 2025-08-02 06:15:21 +02:00
Use BOOST_ASSERT instead of BOOST_CORE_DETAIL_ASSERT
This commit is contained in:
@@ -1,18 +0,0 @@
|
|||||||
/*
|
|
||||||
Copyright 2025 Glen Joseph Fernandes
|
|
||||||
(glenjofe@gmail.com)
|
|
||||||
|
|
||||||
Distributed under the Boost Software License, Version 1.0.
|
|
||||||
(http://www.boost.org/LICENSE_1_0.txt)
|
|
||||||
*/
|
|
||||||
#undef BOOST_CORE_DETAIL_ASSERT
|
|
||||||
|
|
||||||
#if !defined(__clang__) && \
|
|
||||||
!defined(__INTEL_COMPILER) && \
|
|
||||||
defined(__GNUC__) && \
|
|
||||||
(__GNUC__ < 5)
|
|
||||||
#define BOOST_CORE_DETAIL_ASSERT(expr) void(0)
|
|
||||||
#else
|
|
||||||
#include <boost/assert.hpp>
|
|
||||||
#define BOOST_CORE_DETAIL_ASSERT(expr) BOOST_ASSERT(expr)
|
|
||||||
#endif
|
|
@@ -8,8 +8,8 @@ Distributed under the Boost Software License, Version 1.0.
|
|||||||
#ifndef BOOST_CORE_SPAN_HPP
|
#ifndef BOOST_CORE_SPAN_HPP
|
||||||
#define BOOST_CORE_SPAN_HPP
|
#define BOOST_CORE_SPAN_HPP
|
||||||
|
|
||||||
#include <boost/core/detail/assert.hpp>
|
|
||||||
#include <boost/core/data.hpp>
|
#include <boost/core/data.hpp>
|
||||||
|
#include <boost/assert.hpp>
|
||||||
#include <array>
|
#include <array>
|
||||||
#include <iterator>
|
#include <iterator>
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
@@ -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_DETAIL_ASSERT(c <= size()),
|
return BOOST_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_DETAIL_ASSERT(c <= size()),
|
return BOOST_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_DETAIL_ASSERT(o <= size() &&
|
return BOOST_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_DETAIL_ASSERT(i < size()), s_.p[i];
|
return BOOST_ASSERT(i < size()), s_.p[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr reference front() const {
|
constexpr reference front() const {
|
||||||
return BOOST_CORE_DETAIL_ASSERT(!empty()), *s_.p;
|
return BOOST_ASSERT(!empty()), *s_.p;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr reference back() const {
|
constexpr reference back() const {
|
||||||
return BOOST_CORE_DETAIL_ASSERT(!empty()), s_.p[s_.n - 1];
|
return BOOST_ASSERT(!empty()), s_.p[s_.n - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr pointer data() const noexcept {
|
constexpr pointer data() const noexcept {
|
||||||
|
Reference in New Issue
Block a user