C++ Logo


Advanced search

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

From: Ville Voutilainen <ville.voutilainen_at_[hidden]>
Date: Sat, 30 Nov 2019 17:19:08 +0200
On Sat, 30 Nov 2019 at 12:16, Eyal Rozenberg via Std-Proposals
<std-proposals_at_[hidden]> wrote:
> What are the arguments against "at()", other than possibly being redundant?

The argument is that an exception that would be thrown by at() is a
logic error in the program,
and that exceptions should not be used for such logic errors.

Received on 2019-11-30 09:21:43