C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Efficient and silent bounds checking with silent_at()

From: Jason McKesson <jmckesson_at_[hidden]>
Date: Wed, 5 Jul 2023 21:02:17 -0400
On Wed, Jul 5, 2023 at 7:38 PM trtaab trtaab via Std-Proposals
<std-proposals_at_[hidden]> wrote:
>
> Dear ISO C++ Committee,
>
>
>
> I am writing to propose the addition of a new method, "reference silent_at(size_type index) noexcept," to all random access containers in C++. This proposal aims to address the concern of bounds checking in a manner that balances efficiency and safety.
>
> To provide further clarity and support for this proposal, I would like to share some code references that demonstrate the proposed silent_at() method and its benefits.
>
> By studying these code references, it becomes evident that the proposed silent_at() method can offer a pragmatic compromise between the unchecked operator[] and the exception-throwing at() methods. It enables efficient bounds checking while ensuring controlled program termination without producing any output.

OK: how does it do any of those things?

You need to provide something more than a bunch of Godbolt links to
code. You should explain what `silent_at` does, why it does the things
you claim that it does, and why those are important.

Received on 2023-07-06 01:02:31