Skip to content

Commit 5b4f535

Browse files
committed
Added comment about alternative to aligned_storage, closes #20
1 parent b9bbbd8 commit 5b4f535

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/cpp2util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ using in =
384384
template<typename T>
385385
class deferred_init {
386386
bool init = false;
387-
std::aligned_storage<sizeof(T), alignof(T)> data;
387+
std::aligned_storage<sizeof(T), alignof(T)> data; // or: alignas(T) std::byte data[sizeof(T)];
388388

389389
auto t() -> T& { return *std::launder(reinterpret_cast<T*>(&data)); }
390390

0 commit comments

Comments
 (0)