C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Return type of string_view::remove_suffix

From: Peter Olsson <dataapa_at_[hidden]>
Date: Fri, 6 Jan 2023 17:12:46 +0100
> Func( string_view(str).remove_suffix(1u).remove_prefix(2u) );

One concern I have with this is that it becomes less clear that
remove_suffix modifies the string_view object. This does not matter
here but it might matter if called on a variable that gets used later.

This might be a weak argument because append, replace and some
overloads of insert already work the way you propose.

Received on 2023-01-06 16:12:59