C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Add more methods to std::initializer_list instead of overloading

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Sat, 3 Sep 2022 01:12:45 -0400
On Sat, Sep 3, 2022 at 12:51 AM blacktea hamburger via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> I think cbegin/cend/rbegin/rend/crbegin/crend/empty/data methods should be added to std::initializer_list since it already has begin/end methods. This provides consistency, e.g. both il.begin() and il.cbegin() work. This way it does not need to provide overloads for std::initializer_list.

Can't you just use the `ranges::*` functions that do all of those
without having to add a dozen member functions?

Also, what "does not need to provide overloads for std::initializer_list."?

Received on 2022-09-03 05:13:21