-
Notifications
You must be signed in to change notification settings - Fork 121
Open
Description
This is regarding:
constexpr const_reference cstring::back() const noexcept
{
return chars_[N];
}
This back member returns chars_[N], which is the trailing '\0' that cstring stores for C‑string termination.
The last meaningful character sits at index N - 1, so shouldn't back() use return chars_[N - 1] to mirror the std::basic_string::back behavior and avoid always returning the null terminator?
A non-null check on the 'N' is not needed as it is already guaranteed by the constructor that N > 0.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels