diff --git a/dlib/any/storage.h b/dlib/any/storage.h index 0226873904..605b08e93e 100644 --- a/dlib/any/storage.h +++ b/dlib/any/storage.h @@ -525,7 +525,7 @@ namespace dlib } private: - std::aligned_storage_t data; + alignas(Alignment) unsigned char data[Size]; void (*del)(storage_stack&) = nullptr; void (*copy)(const storage_stack&, storage_stack&) = nullptr; void (*move)(storage_stack&, storage_stack&) = nullptr; @@ -773,7 +773,7 @@ namespace dlib } private: - std::aligned_storage_t data; + alignas(Alignment) unsigned char data[Size]; void* ptr = nullptr; void (*del)(storage_sbo&) = nullptr; void (*copy)(const storage_sbo&, storage_sbo&) = nullptr;