C++ Logo

std-proposals

Advanced search

Re: [std-proposals] std::construct<T>

From: Bjorn Reese <breese_at_[hidden]>
Date: Sun, 1 Dec 2024 18:47:49 +0100
On 12/1/24 16:57, Avi Kivity via Std-Proposals wrote:
> Functions and member functions are invocable, but constructors are not.
>
> I propose to add
>
> template <typename T, typename... Args>
> T std::construct(Args&&... args) {
> return T(std::forward<decltype(Args)>(args)...);
> }

What are the constraints?

Should it work for aggregate types?

Should it work for copy/move constructors?

Should it work with cv-qualification?

Received on 2024-12-01 17:47:56