Date: Thu, 26 Jun 2025 17:55:16 -0500
+1 to Jason's comments.
If the proposal is to break `std::vector<int> vec{1, 2, 3, 4, 5};`
then there is a zero percent chance of this happening. Imho.
That being said, there may be approaches to fixing the problems of
std::initializer_list that don't break the desirable aspects.
Cheers,
Jeremy
On Thu, Jun 26, 2025 at 5:38 PM Jason McKesson via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> So, you want:
>
> ```
> std::array<int, 5> arr{1, 2, 3, 4, 5};
> ```
>
> To mean one thing, while:
>
> ```
> std::vector<int> arr{1, 2, 3, 4, 5};
> ```
>
> To just... not work at all.
>
> Half the point of list initialization syntax is so that containers and
> aggregates can use the same syntax to achieve conceptually identical
> results.
>
> Now yes, if the array was of some move-only types, and the
> initializers were all prvalues, this wouldn't work with the `vector`
> version. But it would in basically every other case. What you're
> wanting makes it just never work at all.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
If the proposal is to break `std::vector<int> vec{1, 2, 3, 4, 5};`
then there is a zero percent chance of this happening. Imho.
That being said, there may be approaches to fixing the problems of
std::initializer_list that don't break the desirable aspects.
Cheers,
Jeremy
On Thu, Jun 26, 2025 at 5:38 PM Jason McKesson via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> So, you want:
>
> ```
> std::array<int, 5> arr{1, 2, 3, 4, 5};
> ```
>
> To mean one thing, while:
>
> ```
> std::vector<int> arr{1, 2, 3, 4, 5};
> ```
>
> To just... not work at all.
>
> Half the point of list initialization syntax is so that containers and
> aggregates can use the same syntax to achieve conceptually identical
> results.
>
> Now yes, if the array was of some move-only types, and the
> initializers were all prvalues, this wouldn't work with the `vector`
> version. But it would in basically every other case. What you're
> wanting makes it just never work at all.
> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
Received on 2025-06-26 22:55:29