Skip to content

Commit 496c20f

Browse files
tchaikovNaios
authored andcommitted
stop using std::aligned_storage_t
Previously, we were using std::aligned_storage_t, which was deprecated in C++23, so let's use the equivalent alignas specifier and use an anonymous struct for reserving the internal capacity. Fixes #66 Signed-off-by: Kefu Chai <[email protected]>
1 parent 542a6db commit 496c20f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

include/function2/function2.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,9 @@ struct internal_capacity {
10841084
/// Tag to access the structure in a type-safe way
10851085
data_accessor accessor_;
10861086
/// The internal capacity we use to allocate in-place
1087-
std::aligned_storage_t<Capacity::capacity, Capacity::alignment> capacity_;
1087+
struct alignas(Capacity::alignment) {
1088+
unsigned char data[Capacity::capacity];
1089+
} capacity_;
10881090
} type;
10891091
};
10901092
template <typename Capacity>

0 commit comments

Comments
 (0)