C++ Logo

STD-PROPOSALS

Advanced search

Subject: Re: [std-proposals] function at() for span<> that throws exception on out-of-range, like vector and array ::at()
From: Miguel Ojeda (miguel.ojeda.sandonis_at_[hidden])
Date: 2019-11-30 10:56:05


On Sat, Nov 30, 2019 at 5:40 PM John McFarlane via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> It's not.
>
> Sanitizing user input sounds like something that is best served by explicit logic. I certainly don't think that UI is any concern of containers.

Agreed, but it is nevertheless useful to have a member function like
`at()`. Another useful one would have been one that would simply abort
the program.

Cheers,
Miguel


STD-PROPOSALS list run by herb.sutter at gmail.com

Standard Proposals Archives on Google Groups