C++ Logo

std-proposals

Advanced search

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

From: blacktea hamburger <greenteahamburger_at_[hidden]>
Date: Sat, 3 Sep 2022 12:50:49 +0800
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.

Similar question: https://stackoverflow.com/q/73540342.

Received on 2022-09-03 04:51:16