@@ -49,24 +49,26 @@ struct __allocation_guard {
4949 using _Size _LIBCPP_NODEBUG = typename allocator_traits<_Alloc>::size_type;
5050
5151 template <class _AllocT > // we perform the allocator conversion inside the constructor
52- _LIBCPP_HIDE_FROM_ABI explicit __allocation_guard (_AllocT __alloc, _Size __n)
52+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI explicit __allocation_guard (_AllocT __alloc, _Size __n)
5353 : __alloc_(std::move(__alloc)),
5454 __n_(__n),
5555 __ptr_(allocator_traits<_Alloc>::allocate(__alloc_, __n_)) // initialization order is important
5656 {}
5757
58- _LIBCPP_HIDE_FROM_ABI ~__allocation_guard () _NOEXCEPT { __destroy (); }
58+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI ~__allocation_guard () _NOEXCEPT { __destroy (); }
5959
60- _LIBCPP_HIDE_FROM_ABI __allocation_guard (const __allocation_guard&) = delete;
61- _LIBCPP_HIDE_FROM_ABI __allocation_guard (__allocation_guard&& __other) _NOEXCEPT
60+ __allocation_guard (const __allocation_guard&) = delete ;
61+ __allocation_guard& operator =(const __allocation_guard& __other) = delete ;
62+
63+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI __allocation_guard (__allocation_guard&& __other) _NOEXCEPT
6264 : __alloc_(std::move(__other.__alloc_)),
6365 __n_(__other.__n_),
6466 __ptr_(__other.__ptr_) {
6567 __other.__ptr_ = nullptr ;
6668 }
6769
68- _LIBCPP_HIDE_FROM_ABI __allocation_guard& operator =( const __allocation_guard& __other) = delete ;
69- _LIBCPP_HIDE_FROM_ABI __allocation_guard& operator =(__allocation_guard&& __other) _NOEXCEPT {
70+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI __allocation_guard&
71+ operator =(__allocation_guard&& __other) _NOEXCEPT {
7072 if (std::addressof (__other) != this ) {
7173 __destroy ();
7274
@@ -79,17 +81,17 @@ struct __allocation_guard {
7981 return *this ;
8082 }
8183
82- _LIBCPP_HIDE_FROM_ABI _Pointer
84+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI _Pointer
8385 __release_ptr () _NOEXCEPT { // not called __release() because it's a keyword in objective-c++
8486 _Pointer __tmp = __ptr_;
8587 __ptr_ = nullptr ;
8688 return __tmp;
8789 }
8890
89- _LIBCPP_HIDE_FROM_ABI _Pointer __get () const _NOEXCEPT { return __ptr_; }
91+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI _Pointer __get () const _NOEXCEPT { return __ptr_; }
9092
9193private:
92- _LIBCPP_HIDE_FROM_ABI void __destroy () _NOEXCEPT {
94+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI void __destroy () _NOEXCEPT {
9395 if (__ptr_ != nullptr ) {
9496 allocator_traits<_Alloc>::deallocate (__alloc_, __ptr_, __n_);
9597 }
0 commit comments