C++ Logo


Advanced search

Re: function at() for span<> that throws exception on out-of-range, like vector and array ::at()

From: John McFarlane <john_at_[hidden]>
Date: Sat, 30 Nov 2019 16:40:02 +0000
On Sat, 30 Nov 2019 at 16:31, Lyberta via Std-Proposals <
std-proposals_at_[hidden]> wrote:

> Ville Voutilainen via Std-Proposals:
> > The argument is that an exception that would be thrown by at() is a
> > logic error in the program
> How is sanitizing user input a logic error?

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.

> --
> Std-Proposals mailing list
> Std-Proposals_at_[hidden]
> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2019-11-30 10:42:37