diff --git a/CMakeLists.txt b/CMakeLists.txt index ff5fbedd..a7092c8f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,7 @@ project(psemek) cmake_policy(SET CMP0077 NEW) -set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD 23) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") string(TOUPPER "${CMAKE_BUILD_TYPE}" PSEMEK_BUILD_TYPE) diff --git a/libs/util/include/psemek/util/function.hpp b/libs/util/include/psemek/util/function.hpp index c96a8a62..774d0c32 100644 --- a/libs/util/include/psemek/util/function.hpp +++ b/libs/util/include/psemek/util/function.hpp @@ -23,8 +23,8 @@ namespace psemek::util struct function { private: - static constexpr std::size_t storage_size = sizeof(void*) * 3; - static constexpr std::size_t storage_align = alignof(void*); + static constexpr std::size_t storage_size = sizeof(void *) * 3; + static constexpr std::size_t storage_align = alignof(void *); template struct uses_static_storage @@ -81,7 +81,7 @@ namespace psemek::util void swap(function & other) noexcept; private: - std::aligned_storage_t storage_; + alignas(storage_align) std::byte storage_[storage_size]; struct vtable { diff --git a/libs/util/include/psemek/util/pimpl.hpp b/libs/util/include/psemek/util/pimpl.hpp index 94e69bf9..7f6e84aa 100644 --- a/libs/util/include/psemek/util/pimpl.hpp +++ b/libs/util/include/psemek/util/pimpl.hpp @@ -1,6 +1,5 @@ #pragma once -#include #include #define psemek_declare_pimpl \ @@ -23,7 +22,7 @@ namespace psemek::util::pimpl template struct impl; - template + template struct in_place { protected: @@ -49,8 +48,7 @@ namespace psemek::util::pimpl } private: - - typename std::aligned_storage::type storage_; + alignas(Align) std::byte storage_[Size]; }; template