On Sun, 2024-12-01 at 18:47 +0100, Bjorn Reese via Std-Proposals wrote:
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?
std::constructible_from<T, Args...>
Should it work for aggregate types?
Yes
Should it work for copy/move constructors?
Yes!
Should it work with cv-qualification?
I don't know what's the consensus on that.