@@ -49,24 +49,26 @@ struct __allocation_guard {
49
49
using _Size _LIBCPP_NODEBUG = typename allocator_traits<_Alloc>::size_type;
50
50
51
51
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)
53
53
: __alloc_(std::move(__alloc)),
54
54
__n_(__n),
55
55
__ptr_(allocator_traits<_Alloc>::allocate(__alloc_, __n_)) // initialization order is important
56
56
{}
57
57
58
- _LIBCPP_HIDE_FROM_ABI ~__allocation_guard () _NOEXCEPT { __destroy (); }
58
+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI ~__allocation_guard () _NOEXCEPT { __destroy (); }
59
59
60
- _LIBCPP_HIDE_FROM_ABI __allocation_guard (const __allocation_guard&) = delete;
61
- _LIBCPP_HIDE_FROM_ABI __allocation_guard (__allocation_guard&& __other) _NOEXCEPT
60
+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI __allocation_guard (const __allocation_guard&) = delete;
61
+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI __allocation_guard (__allocation_guard&& __other) _NOEXCEPT
62
62
: __alloc_(std::move(__other.__alloc_)),
63
63
__n_(__other.__n_),
64
64
__ptr_(__other.__ptr_) {
65
65
__other.__ptr_ = nullptr ;
66
66
}
67
67
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 {
68
+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI __allocation_guard&
69
+ operator =(const __allocation_guard& __other) = delete ;
70
+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI __allocation_guard&
71
+ operator =(__allocation_guard&& __other) _NOEXCEPT {
70
72
if (std::addressof (__other) != this ) {
71
73
__destroy ();
72
74
@@ -79,17 +81,17 @@ struct __allocation_guard {
79
81
return *this ;
80
82
}
81
83
82
- _LIBCPP_HIDE_FROM_ABI _Pointer
84
+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI _Pointer
83
85
__release_ptr () _NOEXCEPT { // not called __release() because it's a keyword in objective-c++
84
86
_Pointer __tmp = __ptr_;
85
87
__ptr_ = nullptr ;
86
88
return __tmp;
87
89
}
88
90
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_; }
90
92
91
93
private:
92
- _LIBCPP_HIDE_FROM_ABI void __destroy () _NOEXCEPT {
94
+ _LIBCPP_CONSTEXPR_SINCE_CXX26 _LIBCPP_HIDE_FROM_ABI void __destroy () _NOEXCEPT {
93
95
if (__ptr_ != nullptr ) {
94
96
allocator_traits<_Alloc>::deallocate (__alloc_, __ptr_, __n_);
95
97
}
0 commit comments