[specialized.construct] (original) (raw)

26 Algorithms library [algorithms]

26.11 Specialized algorithms [specialized.algorithms]

26.11.8 construct_at [specialized.construct]

template<class T, class... Args> constexpr T* construct_at(T* location, Args&&... args);namespace ranges { template<class T, class... Args> constexpr T* construct_at(T* location, Args&&... args);}

Constraints: is_unbounded_array_v<T> is false.

The expression ​::​new (declval<void*>()) T(
declval<Args>()...)is well-formed when treated as an unevaluated operand ([expr.context]).

Mandates: If is_array_v<T> is true, sizeof...(Args) is zero.

Effects: Equivalent to:if constexpr (is_array_v<T>) return ::new (voidify(*location)) T[1]();else return ::new (voidify(*location)) T(std::forward<Args>(args)...);