C++ Logo

std-proposals

Advanced search

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

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 01 Dec 2019 09:24:43 -0800
On Saturday, 30 November 2019 12:56:11 PST Ville Voutilainen via Std-Proposals
wrote:
> > IMO, at() was a mistake, as the number of people who call it in the name
> > of "defensive programming" far outweighs the few that call it to sanitize
> > input.
> *baffle* but 'defensive programming' was NEVER the argument of (some
> of) those who advocated for functions that
> would throw on logic errors.

Defensive programming is also what got us Annex K in the C standard.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel System Software Products

Received on 2019-12-01 11:27:08