11
11
12
12
#include < __config>
13
13
#include < __cstddef/size_t.h>
14
- #include < __type_traits/conditional.h>
15
14
#include < __type_traits/integral_constant.h>
16
15
#include < __type_traits/nat.h>
17
16
#include < __type_traits/type_list.h>
@@ -50,22 +49,6 @@ typedef __type_list<__align_type<unsigned char>,
50
49
> > > > > > > > > > __all_types;
51
50
// clang-format on
52
51
53
- template <size_t _Align>
54
- struct _ALIGNAS (_Align) __fallback_overaligned {};
55
-
56
- template <class _TL , size_t _Align>
57
- struct __find_pod ;
58
-
59
- template <class _Hp , size_t _Align>
60
- struct __find_pod <__type_list<_Hp, __nat>, _Align> {
61
- typedef __conditional_t <_Align == _Hp::value, typename _Hp::type, __fallback_overaligned<_Align> > type;
62
- };
63
-
64
- template <class _Hp , class _Tp , size_t _Align>
65
- struct __find_pod <__type_list<_Hp, _Tp>, _Align> {
66
- typedef __conditional_t <_Align == _Hp::value, typename _Hp::type, typename __find_pod<_Tp, _Align>::type> type;
67
- };
68
-
69
52
template <class _TL , size_t _Len>
70
53
struct __find_max_align ;
71
54
@@ -88,9 +71,7 @@ struct __find_max_align<__type_list<_Hp, _Tp>, _Len>
88
71
89
72
template <size_t _Len, size_t _Align = __find_max_align<__all_types, _Len>::value>
90
73
struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_TEMPLATE_VIS aligned_storage {
91
- typedef typename __find_pod<__all_types, _Align>::type _Aligner;
92
- union type {
93
- _Aligner __align;
74
+ union _ALIGNAS (_Align) type {
94
75
unsigned char __data[(_Len + _Align - 1 ) / _Align * _Align];
95
76
};
96
77
};
@@ -104,35 +85,6 @@ _LIBCPP_SUPPRESS_DEPRECATED_POP
104
85
105
86
#endif
106
87
107
- #define _CREATE_ALIGNED_STORAGE_SPECIALIZATION (n ) \
108
- template <size_t _Len> \
109
- struct _LIBCPP_DEPRECATED_IN_CXX23 _LIBCPP_TEMPLATE_VIS aligned_storage<_Len, n> { \
110
- struct _ALIGNAS (n) type { \
111
- unsigned char __lx[(_Len + n - 1 ) / n * n]; \
112
- }; \
113
- }
114
-
115
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x1 );
116
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x2 );
117
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x4 );
118
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x8 );
119
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x10 );
120
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x20 );
121
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x40 );
122
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x80 );
123
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x100 );
124
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x200 );
125
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x400 );
126
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x800 );
127
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x1000 );
128
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x2000 );
129
- // PE/COFF does not support alignment beyond 8192 (=0x2000)
130
- #if !defined(_LIBCPP_OBJECT_FORMAT_COFF)
131
- _CREATE_ALIGNED_STORAGE_SPECIALIZATION (0x4000 );
132
- #endif // !defined(_LIBCPP_OBJECT_FORMAT_COFF)
133
-
134
- #undef _CREATE_ALIGNED_STORAGE_SPECIALIZATION
135
-
136
88
_LIBCPP_END_NAMESPACE_STD
137
89
138
90
#endif // _LIBCPP___TYPE_TRAITS_ALIGNED_STORAGE_H
0 commit comments