Skip to content

Commit e93a0ef

Browse files
ribbon-otterribbon-otter
andauthored
std::aligned_storage_t is deprecated in c++23 (davisking#3100)
Co-authored-by: ribbon-otter <[email protected]>
1 parent 043bed8 commit e93a0ef

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dlib/any/storage.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ namespace dlib
525525
}
526526

527527
private:
528-
std::aligned_storage_t<Size, Alignment> data;
528+
alignas(Alignment) unsigned char data[Size];
529529
void (*del)(storage_stack&) = nullptr;
530530
void (*copy)(const storage_stack&, storage_stack&) = nullptr;
531531
void (*move)(storage_stack&, storage_stack&) = nullptr;
@@ -773,7 +773,7 @@ namespace dlib
773773
}
774774

775775
private:
776-
std::aligned_storage_t<Size, Alignment> data;
776+
alignas(Alignment) unsigned char data[Size];
777777
void* ptr = nullptr;
778778
void (*del)(storage_sbo&) = nullptr;
779779
void (*copy)(const storage_sbo&, storage_sbo&) = nullptr;

0 commit comments

Comments
 (0)