C++ Logo

std-proposals

Advanced search

Re: [std-proposals] String Slicing Draft Proposal

From: Zhihao Yuan <zy_at_[hidden]>
Date: Tue, 26 Mar 2024 19:08:16 +0000
On Tuesday, March 26th, 2024 at 3:46 AM, Giuseppe D'Angelo via Std-Proposals <std-proposals_at_[hidden]> wrote:

>

> I'm really unsure about this last revision: now you have
> std::string::subview which:
>

> * does not return a view (so why is it called sub view?);
> * has different parameters than the existing substr() despite the very
> similar name, so it has a huge surprise factor if one thinks it takes
> pos+count (like substr does).

We can call it "substring" to surprise users
even more, surprising enough for them to
slow down and find the parameter names within
the function signature in auto-completion.

--
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
_______________________________________________

Received on 2024-03-26 19:08:40