2020-02-19 Jonathan Wakely <jwakely@redhat.com>
+ * include/std/memory (uninitialized_construct_using_allocator): Use
+ std::construct_at (LWG 3321).
+
* include/std/memory_resource (polymorphic_allocator::allocate_bytes)
(polymorphic_allocator::allocate_object)
(polymorphic_allocator::new_object): Add nodiscard attribute (LWG3304).
uninitialized_construct_using_allocator(_Tp* __p, const _Alloc& __a,
_Args&&... __args)
{
- void* __vp = const_cast<void*>(static_cast<const volatile void*>(__p));
- return ::new(__vp) _Tp(std::make_obj_using_allocator<_Tp>(__a,
- std::forward<_Args>(__args)...));
+ return std::apply([&](auto&&... __xs) {
+ return std::construct_at(__p, std::forward<decltype(__xs)>(__xs)...);
+ }, std::uses_allocator_construction_args<_Tp>(__a,
+ std::forward<_Args>(__args)...));
}
// @}