From 99b0ac2ed3a7f7ae3c40037a2e0a851784d9e632 Mon Sep 17 00:00:00 2001 From: rexy712 Date: Tue, 24 May 2022 17:35:14 -0700 Subject: [PATCH] Fix storage_for and revert one changed macro to correct constexpr behavior --- CMakeLists.txt | 1 + include/rexy/compat/standard.hpp | 2 +- include/rexy/storage_for.tpp | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a62a974..43b0d96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,6 +70,7 @@ install(FILES ${LIBREXY_BUILT_LIBRARY_HEADERS} DESTINATION "${CMAKE_INSTALL_INCL install(DIRECTORY "include/rexy/detail" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/rexy" FILES_MATCHING PATTERN "*.hpp" PATTERN "*.tpp") install(DIRECTORY "include/rexy/cx" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/rexy" FILES_MATCHING PATTERN "*.hpp" PATTERN "*.tpp") install(DIRECTORY "include/rexy/compat" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/rexy" FILES_MATCHING PATTERN "*.hpp" PATTERN "*.tpp") +install(DIRECTORY "include/rexy/concepts" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/rexy" FILES_MATCHING PATTERN "*.hpp" PATTERN "*.tpp") configure_file( "${CMAKE_CURRENT_SOURCE_DIR}/pc/librexy.pc.cmake.in" diff --git a/include/rexy/compat/standard.hpp b/include/rexy/compat/standard.hpp index 0082b85..2b269b6 100644 --- a/include/rexy/compat/standard.hpp +++ b/include/rexy/compat/standard.hpp @@ -19,7 +19,7 @@ #ifndef REXY_COMPAT_CPP20_HPP #define REXY_COMPAT_CPP20_HPP - #ifdef __cpp_consteval + #if __cplusplus >= 202002L #define REXY_CPP20_CONSTEXPR constexpr #define REXY_CPP20_CONSTEVAL consteval #else //__cpp_consteval diff --git a/include/rexy/storage_for.tpp b/include/rexy/storage_for.tpp index 0ea755a..8e8063f 100644 --- a/include/rexy/storage_for.tpp +++ b/include/rexy/storage_for.tpp @@ -58,7 +58,7 @@ namespace rexy{ } } template - constexpr storage_for::~storage_for(void)noexcept(std::is_nothrow_destructible::value){ + REXY_CPP20_CONSTEXPR storage_for::~storage_for(void)noexcept(std::is_nothrow_destructible::value){ if(m_dirty){ destroy(); } @@ -185,7 +185,7 @@ namespace rexy{ m_dirty = 1; } template - constexpr storage_for::~storage_for(void)noexcept(std::is_nothrow_destructible::value){ + REXY_CPP20_CONSTEXPR storage_for::~storage_for(void)noexcept(std::is_nothrow_destructible::value){ if(m_dirty){ destroy(); }