@@ -74,7 +74,7 @@ namespace std _GLIBCXX_VISIBILITY(default)
{
_GLIBCXX_BEGIN_NAMESPACE_VERSION
-#if __cplusplus >= 201703L
+#if __glibcxx_raw_memory_algorithms // >= C++17
template <typename _Tp>
_GLIBCXX20_CONSTEXPR inline void
destroy_at(_Tp* __location)
@@ -88,7 +88,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__location->~_Tp();
}
-#if __cplusplus >= 202002L
+#if __cpp_constexpr_dynamic_alloc // >= C++20
template<typename _Tp, typename... _Args>
constexpr auto
construct_at(_Tp* __location, _Args&&... __args)
@@ -108,7 +108,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
inline void
_Construct(_Tp* __p, _Args&&... __args)
{
-#if __cplusplus >= 202002L
+#if __cpp_constexpr_dynamic_alloc // >= C++20
if (std::__is_constant_evaluated())
{
// Allow std::_Construct to be used in constant expressions.
@@ -145,7 +145,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
_GLIBCXX14_CONSTEXPR inline void
_Destroy(_Tp* __pointer)
{
-#if __cplusplus > 201703L
+#if __cpp_constexpr_dynamic_alloc // >= C++20
std::destroy_at(__pointer);
#else
__pointer->~_Tp();
@@ -188,7 +188,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static_assert(is_destructible<_Value_type>::value,
"value type is destructible");
#endif
-#if __cplusplus >= 202002L
+#if __cpp_constexpr_dynamic_alloc // >= C++20
if (std::__is_constant_evaluated())
return std::_Destroy_aux<false>::__destroy(__first, __last);
#endif
@@ -237,7 +237,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static_assert(is_destructible<_Value_type>::value,
"value type is destructible");
#endif
-#if __cplusplus >= 202002L
+#if __cpp_constexpr_dynamic_alloc // >= C++20
if (std::__is_constant_evaluated())
return std::_Destroy_n_aux<false>::__destroy_n(__first, __count);
#endif
@@ -245,7 +245,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
__destroy_n(__first, __count);
}
-#if __cplusplus >= 201703L
+#if __glibcxx_raw_memory_algorithms // >= C++17
template <typename _ForwardIterator>
_GLIBCXX20_CONSTEXPR inline void
destroy(_ForwardIterator __first, _ForwardIterator __last)