std::pmr::polymorphic_allocator<T>::new_object

Allocates and constructs an object of type U.

# Declarations

template< class U, class... CtorArgs >
U* new_object( CtorArgs&&... ctor_args );

(since C++20)

# Parameters

# Return value

A pointer to the allocated and constructed object.

# Notes

This function was introduced for use with the fully-specialized allocator std::pmr::polymorphic_allocator<>, but it may be useful in any specialization as a shortcut to avoid having to rebind from std::pmr::polymorphic_allocator to std::pmr::polymorphic_allocator, and having to call allocate, construct, and deallocate individually.

Since U is not deduced, it must be provided as a template argument when calling this function.

# See also