Remove uses of BOOST_SP_NOEXCEPT from allocate_shared_array.hpp

This commit is contained in:
Peter Dimov
2024-10-02 21:21:06 +03:00
parent b4174f66fa
commit 82bee8581d

View File

@@ -60,7 +60,7 @@ struct sp_align_up {
template<class T> template<class T>
BOOST_CONSTEXPR inline std::size_t BOOST_CONSTEXPR inline std::size_t
sp_objects(std::size_t size) BOOST_SP_NOEXCEPT sp_objects(std::size_t size) noexcept
{ {
return (size + sizeof(T) - 1) / sizeof(T); return (size + sizeof(T) - 1) / sizeof(T);
} }
@@ -71,15 +71,15 @@ public:
typedef A type; typedef A type;
template<class U> template<class U>
sp_array_state(const U& _allocator, std::size_t _size) BOOST_SP_NOEXCEPT sp_array_state(const U& _allocator, std::size_t _size) noexcept
: allocator_(_allocator), : allocator_(_allocator),
size_(_size) { } size_(_size) { }
A& allocator() BOOST_SP_NOEXCEPT { A& allocator() noexcept {
return allocator_; return allocator_;
} }
std::size_t size() const BOOST_SP_NOEXCEPT { std::size_t size() const noexcept {
return size_; return size_;
} }
@@ -94,14 +94,14 @@ public:
typedef A type; typedef A type;
template<class U> template<class U>
sp_size_array_state(const U& _allocator, std::size_t) BOOST_SP_NOEXCEPT sp_size_array_state(const U& _allocator, std::size_t) noexcept
: allocator_(_allocator) { } : allocator_(_allocator) { }
A& allocator() BOOST_SP_NOEXCEPT { A& allocator() noexcept {
return allocator_; return allocator_;
} }
BOOST_CONSTEXPR std::size_t size() const BOOST_SP_NOEXCEPT { BOOST_CONSTEXPR std::size_t size() const noexcept {
return N; return N;
} }
@@ -126,7 +126,7 @@ struct sp_array_offset {
template<class U, class T> template<class U, class T>
inline U* inline U*
sp_array_start(T* base) BOOST_SP_NOEXCEPT sp_array_start(T* base) noexcept
{ {
enum { enum {
size = sp_array_offset<T, U>::value size = sp_array_offset<T, U>::value
@@ -147,7 +147,7 @@ class sp_array_creator {
public: public:
template<class U> template<class U>
sp_array_creator(const U& other, std::size_t size) BOOST_SP_NOEXCEPT sp_array_creator(const U& other, std::size_t size) noexcept
: other_(other), : other_(other),
size_(sp_objects<type>(offset + sizeof(element) * size)) { } size_(sp_objects<type>(offset + sizeof(element) * size)) { }
@@ -191,33 +191,33 @@ public:
boost::first_scalar(&list), count); boost::first_scalar(&list), count);
} }
T& state() BOOST_SP_NOEXCEPT { T& state() noexcept {
return state_; return state_;
} }
void dispose() BOOST_SP_NOEXCEPT BOOST_OVERRIDE { void dispose() noexcept BOOST_OVERRIDE {
boost::alloc_destroy_n(state_.allocator(), boost::alloc_destroy_n(state_.allocator(),
boost::first_scalar(sp_array_start<type>(this)), boost::first_scalar(sp_array_start<type>(this)),
state_.size() * sp_array_count<type>::value); state_.size() * sp_array_count<type>::value);
} }
void destroy() BOOST_SP_NOEXCEPT BOOST_OVERRIDE { void destroy() noexcept BOOST_OVERRIDE {
sp_array_creator<allocator, sp_array_base> other(state_.allocator(), sp_array_creator<allocator, sp_array_base> other(state_.allocator(),
state_.size()); state_.size());
this->~sp_array_base(); this->~sp_array_base();
other.destroy(this); other.destroy(this);
} }
void* get_deleter(const sp_typeinfo_&) BOOST_SP_NOEXCEPT BOOST_OVERRIDE { void* get_deleter(const sp_typeinfo_&) noexcept BOOST_OVERRIDE {
return 0; return 0;
} }
void* get_local_deleter(const sp_typeinfo_&) void* get_local_deleter(const sp_typeinfo_&)
BOOST_SP_NOEXCEPT BOOST_OVERRIDE { noexcept BOOST_OVERRIDE {
return 0; return 0;
} }
void* get_untyped_deleter() BOOST_SP_NOEXCEPT BOOST_OVERRIDE { void* get_untyped_deleter() noexcept BOOST_OVERRIDE {
return 0; return 0;
} }
@@ -239,11 +239,11 @@ public:
} }
} }
T* get() const BOOST_SP_NOEXCEPT { T* get() const noexcept {
return result_; return result_;
} }
void release() BOOST_SP_NOEXCEPT { void release() noexcept {
result_ = 0; result_ = 0;
} }