Set default supported C++ standard version to C++23

Fix deprecation of std::aligned_storage
This commit is contained in:
Nikita Lisitsa 2026-08-14 16:37:00 +03:00
parent ce5531dbbb
commit 17be2f3aaa
3 changed files with 6 additions and 8 deletions

View file

@ -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)

View file

@ -81,7 +81,7 @@ namespace psemek::util
void swap(function & other) noexcept;
private:
std::aligned_storage_t<storage_size, storage_align> storage_;
alignas(storage_align) std::byte storage_[storage_size];
struct vtable
{

View file

@ -1,6 +1,5 @@
#pragma once
#include <type_traits>
#include <memory>
#define psemek_declare_pimpl \
@ -23,7 +22,7 @@ namespace psemek::util::pimpl
template <typename Parent>
struct impl;
template <typename Parent, std::size_t Size>
template <typename Parent, std::size_t Size, std::size_t Align = alignof(std::max_align_t)>
struct in_place
{
protected:
@ -49,8 +48,7 @@ namespace psemek::util::pimpl
}
private:
typename std::aligned_storage<Size>::type storage_;
alignas(Align) std::byte storage_[Size];
};
template <typename Parent>