C++ Logo

std-proposals

Advanced search

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

From: trtaab trtaab <tvfvof_at_[hidden]>
Date: Thu, 6 Jul 2023 02:00:29 +0000
Dear Thiago Macieira,

Thank you for your continued engagement in the discussion. I understand your point regarding the use of assertions and their potential inclusion in the operator[] method.

Regarding the term "silent crash," I apologize for any confusion caused. By "silent," I meant the absence of any output through stdio, not to be confused with a complete absence of any indication of a crash. The intention is to avoid any additional output that may be generated by the standard library, such as error messages or debug information, while still terminating the program in a controlled manner.

In response to your suggestion of adding assertions to the operator[] method, I acknowledge the potential benefits it may offer. However, doing so could lead to One-Definition Rule (ODR) violations when multiple versions of the container, with and without assertions, are used within the same program. This could cause conflicts during linkage and introduce ambiguity in the behavior of the program.

The proposed silent_at method provides a separate interface that specifically addresses the need for efficient bounds checking while allowing developers to choose the appropriate level of safety for their use cases. By introducing a distinct method, we can ensure clarity, consistency, and compatibility across different implementations and use scenarios.

I hope this explanation clarifies the rationale behind the proposal. Your insights and feedback are invaluable, and I appreciate the opportunity to discuss these considerations with you.

If you have any further questions or concerns, please do not hesitate to let me know.

Sincerely.
Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows



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