libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ _Construct()

template<typename _Tp, typename... _Args>
void std::_Construct ( _Tp * __p,
_Args &&... __args )
inlineconstexpr

Constructs an object in existing memory by invoking an allocated object's constructor with an initializer.

Definition at line 123 of file stl_construct.h.

124 {
125#if __cpp_constexpr_dynamic_alloc // >= C++20
126 if (std::is_constant_evaluated())
127 {
128 // Allow std::_Construct to be used in constant expressions.
129 std::construct_at(__p, std::forward<_Args>(__args)...);
130 return;
131 }
132#endif
133 ::new(static_cast<void*>(__p)) _Tp(std::forward<_Args>(__args)...);
134 }
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
Definition move.h:72
constexpr _Tp * construct_at(_Tp *__location, _Args &&... __args) noexcept(noexcept(::new((void *) 0) _Tp(std::declval< _Args >()...)))

References _Construct(), construct_at(), and forward().

Referenced by std::__uninitialized_construct_buf_dispatch< bool >::__ucr(), __gnu_cxx::__uninitialized_copy_n(), _Construct(), std::allocator_traits< _OuterAlloc >::construct(), std::allocator_traits< allocator< _Tp > >::construct(), std::allocator_traits< allocator< void > >::construct(), std::raw_storage_iterator< _OutputIterator, _Tp >::operator=(), and std::raw_storage_iterator< _OutputIterator, _Tp >::operator=().

Here is the call graph for this function:
Here is the caller graph for this function: