constexpr basic_string_view basic_string::operator[](size_t start, size_t end) const;
That would allow the syntax to be very close to python:
if (my_string[5,10] == "something") { ... }Has that been considered?Best REgards,Breno G.
Hi all,I've now added proposed wording and incorporated more of the given feedback. Once again, my many thanks for the suggestions and critique!Sincerely,Op vr 15 mrt 2024 om 11:58 schreef Rhidian De Wit <rhidiandewit@gmail.com>:Thanks to everyone so far for pointing out oversights and errors, I've updated my proposal with the given feedback, and I've added a sample Github project with implementation and unit tests.Sincerely,Op do 14 mrt 2024 om 09:00 schreef Jonathan Wakely <cxx@kayari.org>:On Thu, 14 Mar 2024, 07:50 Rhidian De Wit via Std-Proposals, <std-proposals@lists.isocpp.org> wrote:Hi all,With some helpful suggestions, I'd like to present my draft proposal for the inclusion of several new utility functions to be added to std::basic_string.Please reach out if you have any questions, concerns or feedback!Your example implementations for both slice functions have undefined behaviour of the start is out of range. Is that intentional? It's not possible to tell because your technical specification doesn't really follow the form of standard specifications.--Sincerely,--Rhidian De WitSoftware Engineer - Barco
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals
--Rhidian De WitSoftware Engineer - Barco----Rhidian De WitSoftware Engineer - Barco
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals