Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

string_view::copy should throw std::out_of_range #362

Closed
BillyDonahue opened this issue Aug 2, 2019 · 0 comments
Closed

string_view::copy should throw std::out_of_range #362

BillyDonahue opened this issue Aug 2, 2019 · 0 comments
Assignees

Comments

@BillyDonahue
Copy link

In the spirit of #355, absl::string_view::copy should also throw std::out_of_range when pos > size().

https://en.cppreference.com/w/cpp/string/basic_string_view/copy

vs

https://github.com/abseil/abseil-cpp/blob/14550beb3b/absl/strings/string_view.cc#L83

assert(pos <= ulen);
@derekmauro derekmauro self-assigned this Aug 3, 2019
4s5t2os41n added a commit to 4s5t2os41n/abseil-cpp that referenced this issue Jul 4, 2024
--
5315e7b98905922e779798f3168d98343438c134 by Derek Mauro <dmauro@google.com>:

Fix absl::string_view::copy to throw std::out_of_range when pos > size().

Fixes abseil/abseil-cpp#362

PiperOrigin-RevId: 261907364
GitOrigin-RevId: 5315e7b98905922e779798f3168d98343438c134
Change-Id: Ia8ab971c54f287411f6ea4b99f9c666c989c33fd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants