You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This section talks about how the index operator [] causes runtime errors. It doesn't on any of the compilers I've tested with unless you go way out of your way to make that happen.
The .at() member of string is actually defined to use bounds checking, but the text never mentions it.
Couple of choices here:
remove the section
switch the chapter to prefer .at()
use examples like x[999999] to demonstrate a crash (will require rewriting a bit of the text, too since it claims that str[str.length()] causes a runtime error (it doesn't).
The text was updated successfully, but these errors were encountered:
wrigjl
changed the title
Chapter7/runtime_error.rst
Chapter7/runtime_error.rst [] does NOT generate bounds check
Sep 18, 2024
This section talks about how the index operator [] causes runtime errors. It doesn't on any of the compilers I've tested with unless you go way out of your way to make that happen.
The .at() member of string is actually defined to use bounds checking, but the text never mentions it.
Couple of choices here:
.at()
The text was updated successfully, but these errors were encountered: