@@ -90,7 +90,6 @@ namespace std {
90
90
# include < __memory/unique_ptr.h>
91
91
# include < __type_traits/add_cv_quals.h>
92
92
# include < __type_traits/add_pointer.h>
93
- # include < __type_traits/aligned_storage.h>
94
93
# include < __type_traits/conditional.h>
95
94
# include < __type_traits/decay.h>
96
95
# include < __type_traits/enable_if.h>
@@ -148,14 +147,13 @@ template <class _ValueType>
148
147
_LIBCPP_HIDE_FROM_ABI add_pointer_t <_ValueType> any_cast (any*) _NOEXCEPT;
149
148
150
149
namespace __any_imp {
151
- _LIBCPP_SUPPRESS_DEPRECATED_PUSH
152
- using _Buffer _LIBCPP_NODEBUG = aligned_storage_t <3 * sizeof (void *), alignof (void *)>;
153
- _LIBCPP_SUPPRESS_DEPRECATED_POP
150
+ inline constexpr size_t __small_buffer_size = 3 * sizeof (void *);
151
+ inline constexpr size_t __small_buffer_alignment = alignof (void *);
154
152
155
153
template <class _Tp >
156
154
using _IsSmallObject _LIBCPP_NODEBUG =
157
155
integral_constant<bool ,
158
- sizeof (_Tp) <= sizeof (_Buffer) && alignof (_Buffer) % alignof ( _Tp) == 0 &&
156
+ sizeof (_Tp) <= __small_buffer_size && alignof (_Tp) <= __small_buffer_alignment &&
159
157
is_nothrow_move_constructible<_Tp>::value >;
160
158
161
159
enum class _Action { _Destroy, _Copy, _Move, _Get, _TypeInfo };
@@ -285,7 +283,7 @@ private:
285
283
union _Storage {
286
284
_LIBCPP_HIDE_FROM_ABI constexpr _Storage () : __ptr (nullptr ) {}
287
285
void * __ptr;
288
- __any_imp::_Buffer __buf;
286
+ alignas ( __any_imp::__small_buffer_alignment) char __buf[__any_imp::__small_buffer_size] ;
289
287
};
290
288
291
289
_LIBCPP_HIDE_FROM_ABI void *
0 commit comments