C++ Logo


Advanced search

Re: List initialize from tuple

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Sat, 13 Feb 2021 17:45:51 +0200
On Sat, 13 Feb 2021 at 15:31, Jefferson Carpenter via Std-Discussion
<std-discussion_at_[hidden]> wrote:
> On 2/13/2021 9:29 AM, Ville Voutilainen via Std-Discussion wrote:
> > On Sat, 13 Feb 2021 at 10:28, Bo Persson via Std-Discussion
> > <std-discussion_at_[hidden]> wrote:
> >> As Ville points out, the solution apparently was to generalize the ()
> >> initializer, not to change make_from_tuple.
> >
> > Right, that made existing factory functions Just Work, instead of
> > having them opt into some
> > new facility that we might entertain adopting. I.e.
> > https://isocpp.org/files/papers/D2157R0.html
> > I should reformat that a bit and add make_from_tuple to it and publish it.
> >
> Thanks! Definitely take my questions as questions only, not as anything
> approaching a proposal. I know C++ pretty well, but not nearly well
> enough to know the spot to make a change to improve the language.

No worries. The long and winding history of this problem has had it suggested
to be solved in the library facilities by first checking whether the
type is constructible
and then falling back to brace-init, by using brace-init for
aggregates, by using
a proposed deferred-evaluation mechanism, etc. etc. P0960 was written because
various people, me included, wanted the paren-init to Just Work,
without necessitating
any of the aforementioned techniques in the standard library
facilities and especially
in user code written by non-experts.

Received on 2021-02-13 09:46:05