C++ Logo

std-proposals

Advanced search

Re: [std-proposals] .first() and .last() in strings

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Tue, 14 May 2024 10:02:36 +0200
In the description of the functions in the proposal the basic_string variants still have a noexcept guarantee.   -----Ursprüngliche Nachricht----- Von:Rhidian De Wit via Std-Proposals <std-proposals_at_[hidden]> Gesendet:Di 14.05.2024 08:43 Betreff:Re: [std-proposals] .first() and .last() in strings Anlage:index.html An:std-proposals_at_[hidden]; CC:Rhidian De Wit <rhidiandewit_at_[hidden]>; Giuseppe D‘Angelo <giuseppe.dangelo_at_[hidden]>; Thank you for your useful insights! The proposal on substr() && was an interesting read! I've now updated the proposal.  Sincerely,   Op ma 13 mei 2024 om 11:06 schreef Giuseppe D'Angelo via Std-Proposals <std-proposals_at_[hidden] <mailto:std-proposals_at_[hidden]> >: Hi, Il 13/05/24 09:29, Rhidian De Wit via Std-Proposals ha scritto: > Hi, > Here is the latest version of my proposal, and I wonder, how do I now > continue with this proposal? Do I email for an official number? Couple of minor comments: * first/last for basic_string can't be noexcept (they need to allocate); * just like basic_string::substr, first/last need an overload for rvalue *this (see P2438R2); * I'm actually a bit surprised that the existing `substr() &&` overload is not noexcept. Is there any reason for that? Yes, it calls the `basic_string(basic_string &&, size_t pos, Allocator)` constructor which isn't noexcept, but this just raises the question as of why there isn't a `basic_string(basic_string &&, size_t pos) noexcept` constructor. * in the wording there is no need of spelling out the template parameters for the return type. Instead of > constexpr basic_string_view<charT, traits> first(size_t count) const noexcept use > constexpr basic_string_view first(size_t count) const noexcept (mut.mut. for the rest) My 2 c, -- Giuseppe D'Angelo -- Std-Proposals mailing list Std-Proposals_at_[hidden] <mailto:Std-Proposals_at_[hidden]> https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals  -- Rhidian De Wit Software Engineer - Barco -- Std-Proposals mailing list Std-Proposals_at_[hidden] https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals

Received on 2024-05-14 08:02:39