@@ -80,7 +80,6 @@ using EnableIfCallable = std::enable_if_t<std::disjunction<
80
80
template <typename ReturnT, typename ... ParamTs> class UniqueFunctionBase {
81
81
protected:
82
82
static constexpr size_t InlineStorageSize = sizeof (void *) * 3 ;
83
- static constexpr size_t InlineStorageAlign = alignof (void *);
84
83
85
84
template <typename T, class = void >
86
85
struct IsSizeLessThanThresholdT : std::false_type {};
@@ -162,8 +161,7 @@ template <typename ReturnT, typename... ParamTs> class UniqueFunctionBase {
162
161
// provide three pointers worth of storage here.
163
162
// This is mutable as an inlined `const unique_function<void() const>` may
164
163
// still modify its own mutable members.
165
- alignas (InlineStorageAlign) mutable std::byte
166
- InlineStorage[InlineStorageSize];
164
+ alignas (void *) mutable std::byte InlineStorage[InlineStorageSize];
167
165
} StorageUnion;
168
166
169
167
// A compressed pointer to either our dispatching callback or our table of
@@ -264,7 +262,7 @@ template <typename ReturnT, typename... ParamTs> class UniqueFunctionBase {
264
262
bool IsInlineStorage = true ;
265
263
void *CallableAddr = getInlineStorage ();
266
264
if (sizeof (CallableT) > InlineStorageSize ||
267
- alignof (CallableT) > InlineStorageAlign ) {
265
+ alignof (CallableT) > alignof ( decltype (StorageUnion. InlineStorage )) ) {
268
266
IsInlineStorage = false ;
269
267
// Allocate out-of-line storage. FIXME: Use an explicit alignment
270
268
// parameter in C++17 mode.
0 commit comments