C++ Logo

std-proposals

Advanced search

Re: [std-proposals] replace

From: Thiago Macieira <thiago_at_[hidden]>
Date: Sun, 01 May 2022 14:13:57 -0700
On Sunday, 1 May 2022 11:48:05 PDT Bo Persson via Std-Proposals wrote:
> On 2022-05-01 at 11:37, Abdullah Qasim via Std-Proposals wrote:
> > void replace (const char* const to_replace, const char* const with,
> > char* to_change)
> >
> > char* replace (const char* const, const char* const)
>
> If you use std::string instead of char*, you already have 9 different
> versions of replace
>
> https://en.cppreference.com/w/cpp/string/basic_string/replace

And if you want to have a free function that works in C, please address it to
the C committee (which doesn't have a mailing list, you have to write an
actual paper). You'll want to discuss what happens if the lengths of the
needle and the replacement are different.

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel DPG Cloud Engineering

Received on 2022-05-01 21:13:58