Date: Tue, 15 Jul 2025 23:50:22 +0300
On Tue, 2025-07-15 at 15:59 +0200, Jan Schultke wrote:
> I recall discussing this with other people at some point; not sure if
> there's already an existing proposal for it.
>
> I think it's well-motivated; we have function objects for std::plus/+
> and other sort of builtin things that you cannot (always) for a
> function pointer to, and this fits right in with those.
>
> However, std::construct is a bad name. You're basically making a
> callable type in the style of std::plus and std::less; all of those
> are named using a noun, presumably because they are not functions.
> std::construct sounds dangerously close to std::construct_at; there's
> some potential for confusion.
>
> Something like std::construction or std::constructor would be more
> fitting for that type.
My second favorite is std::make<T>. Since we have
std::make_from_tuple<T>, which does something similar.
I listed a few others in the Naming section.
std::construction<T> sounds wrong to me. It's a function object, so it
should be a verb, not a noun. Although std::plus isn't a verb.
> I recall discussing this with other people at some point; not sure if
> there's already an existing proposal for it.
>
> I think it's well-motivated; we have function objects for std::plus/+
> and other sort of builtin things that you cannot (always) for a
> function pointer to, and this fits right in with those.
>
> However, std::construct is a bad name. You're basically making a
> callable type in the style of std::plus and std::less; all of those
> are named using a noun, presumably because they are not functions.
> std::construct sounds dangerously close to std::construct_at; there's
> some potential for confusion.
>
> Something like std::construction or std::constructor would be more
> fitting for that type.
My second favorite is std::make<T>. Since we have
std::make_from_tuple<T>, which does something similar.
I listed a few others in the Naming section.
std::construction<T> sounds wrong to me. It's a function object, so it
should be a verb, not a noun. Although std::plus isn't a verb.
Received on 2025-07-15 20:50:26