10 Oct
2013
10 Oct
'13
6:56 p.m.
On 10 October 2013 12:09, Thorsten Ottosen
I guess it's because I view the precondition as the requirement for correct execution. It's the same for both functions. They differ in how they respond to an incorrect argument. UB vs. an exception.
That's you. The standard is quite clear on this: n3690 23.2.4p17: "The member function at() provides bounds-checked access to container elements. at() throws out_of_-range if n >= a.size()." Not fitting your mental model is not a bug in the standard... -- Nevin ":-)" Liber mailto:nevin@eviloverlord.com (847) 691-1404