libstdc++: Simplify std::allocator_traits<allocator<void>>::construct

We don't need a preprocessor condition to decide whether to use
placement new or std::construct_at, because std::_Construct already does
that.

libstdc++-v3/ChangeLog:

	* include/bits/alloc_traits.h (allocator_traits<allocator<void>>):
	Use std::_Construct for construct.
This commit is contained in:
Jonathan Wakely 2022-01-04 16:39:01 +00:00
parent cebe875f6f
commit 917c7b136e

View File

@ -632,13 +632,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
static _GLIBCXX20_CONSTEXPR void static _GLIBCXX20_CONSTEXPR void
construct(allocator_type&, _Up* __p, _Args&&... __args) construct(allocator_type&, _Up* __p, _Args&&... __args)
noexcept(std::is_nothrow_constructible<_Up, _Args...>::value) noexcept(std::is_nothrow_constructible<_Up, _Args...>::value)
{ { std::_Construct(__p, std::forward<_Args>(__args)...); }
#if __cplusplus <= 201703L
::new((void *)__p) _Up(std::forward<_Args>(__args)...);
#else
std::construct_at(__p, std::forward<_Args>(__args)...);
#endif
}
/** /**
* @brief Destroy an object of type `_Up` * @brief Destroy an object of type `_Up`