Fix storage_for and revert one changed macro to correct constexpr behavior

This commit is contained in:
rexy712 2022-05-24 17:35:14 -07:00
parent 2578895b40
commit 99b0ac2ed3
3 changed files with 4 additions and 3 deletions

View File

@ -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/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/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/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( configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/pc/librexy.pc.cmake.in" "${CMAKE_CURRENT_SOURCE_DIR}/pc/librexy.pc.cmake.in"

View File

@ -19,7 +19,7 @@
#ifndef REXY_COMPAT_CPP20_HPP #ifndef REXY_COMPAT_CPP20_HPP
#define REXY_COMPAT_CPP20_HPP #define REXY_COMPAT_CPP20_HPP
#ifdef __cpp_consteval #if __cplusplus >= 202002L
#define REXY_CPP20_CONSTEXPR constexpr #define REXY_CPP20_CONSTEXPR constexpr
#define REXY_CPP20_CONSTEVAL consteval #define REXY_CPP20_CONSTEVAL consteval
#else //__cpp_consteval #else //__cpp_consteval

View File

@ -58,7 +58,7 @@ namespace rexy{
} }
} }
template<class T> template<class T>
constexpr storage_for<T>::~storage_for(void)noexcept(std::is_nothrow_destructible<value_type>::value){ REXY_CPP20_CONSTEXPR storage_for<T>::~storage_for(void)noexcept(std::is_nothrow_destructible<value_type>::value){
if(m_dirty){ if(m_dirty){
destroy(); destroy();
} }
@ -185,7 +185,7 @@ namespace rexy{
m_dirty = 1; m_dirty = 1;
} }
template<class T> template<class T>
constexpr storage_for<T>::~storage_for(void)noexcept(std::is_nothrow_destructible<value_type>::value){ REXY_CPP20_CONSTEXPR storage_for<T>::~storage_for(void)noexcept(std::is_nothrow_destructible<value_type>::value){
if(m_dirty){ if(m_dirty){
destroy(); destroy();
} }