Topic: Overloaded member functions substr of the


Author: =?UTF-8?B?R2HFoXBlciBBxb5tYW4=?= <gasper.azman@gmail.com>
Date: Fri, 25 May 2018 13:35:13 +0100
Raw View
--00000000000017afa7056d07014a
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

So, Vlad, are you writing a paper?

G

On Fri, May 25, 2018 at 1:22 PM, 'Vlad from Moscow' via ISO C++ Standard -
Future Proposals <std-proposals@isocpp.org> wrote:

> In fact most of the member functions that create a new representation of
> the object of the class template std::basic_string have an overload that
> uses iterators as for example assign, append, insert, replace, erase. And
> only the member function substr does not use iterators..
>
> =D1=87=D0=B5=D1=82=D0=B2=D0=B5=D1=80=D0=B3, 24 =D0=BC=D0=B0=D1=8F 2018 =
=D0=B3., 20:18:39 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=
=82=D0=B5=D0=BB=D1=8C Nicol Bolas =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=
=BB:
>>
>> On Thursday, May 24, 2018 at 11:28:32 AM UTC-4, Vlad from Moscow wrote:
>>>
>>> I do not think that adding the overloads of substr makes the class more
>>> complex.
>>>
>>
>> I'm sure every proposal that added some functions to `basic_string` said
>> the same thing. That kind of thinking is precisely how you get bloated
>> interfaces.
>>
>> Those grains of seemingly irrelevant sand eventually add up to a desert.
>>
>> That being said, I don't think `basic_string`'s interface is
>> *unnecessarily* bloated. I find that (most of) those functions are
>> essential, but mainly because there are no equivalent algorithms that ca=
n
>> do those jobs anywhere nearly as conveniently, clearly, and effectively.
>>
>> `str.find("foo"sv)` is hundreds of times more digestible than `auto look
>> =3D "foo"sv; std::search(str.begin(), str.end(), look.begin(), look.end(=
));`
>> Range TS gives us `std::search(str, "foo"sv)`, which is pretty reasonabl=
e.
>>
> --
> You received this message because you are subscribed to the Google Groups
> "ISO C++ Standard - Future Proposals" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to std-proposals+unsubscribe@isocpp.org.
> To post to this group, send email to std-proposals@isocpp.org.
> To view this discussion on the web visit https://groups.google.com/a/
> isocpp.org/d/msgid/std-proposals/9c62c391-1593-437d-
> b839-ce62472cf0ea%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/9c62c391-15=
93-437d-b839-ce62472cf0ea%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/CAANG%3DkVyVpTzS74BYKin6yEpvwh1AXCyS1sF53ck9i%2B=
J%2BdvqMQ%40mail.gmail.com.

--00000000000017afa7056d07014a
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">So, Vlad, are you writing a paper?<div><br></div><div>G</d=
iv></div><div class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Fri, =
May 25, 2018 at 1:22 PM, &#39;Vlad from Moscow&#39; via ISO C++ Standard - =
Future Proposals <span dir=3D"ltr">&lt;<a href=3D"mailto:std-proposals@isoc=
pp.org" target=3D"_blank">std-proposals@isocpp.org</a>&gt;</span> wrote:<br=
><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1=
px #ccc solid;padding-left:1ex"><div dir=3D"ltr">In fact most of the member=
 functions that create a new representation of the object of the class temp=
late std::basic_string have an overload that uses iterators as for example =
assign, append, insert, replace, erase. And only the member function substr=
 does not use iterators..<br><br>=D1=87=D0=B5=D1=82=D0=B2=D0=B5=D1=80=D0=B3=
, 24 =D0=BC=D0=B0=D1=8F 2018 =D0=B3., 20:18:39 UTC+3 =D0=BF=D0=BE=D0=BB=D1=
=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Nicol Bolas =D0=BD=D0=
=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<span class=3D"gmail-"><blockquote class=
=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rg=
b(204,204,204);padding-left:1ex"><div dir=3D"ltr">On Thursday, May 24, 2018=
 at 11:28:32 AM UTC-4, Vlad from Moscow wrote:<blockquote class=3D"gmail_qu=
ote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,20=
4);padding-left:1ex"><div dir=3D"ltr">I do not think that adding the overlo=
ads of substr makes the class more complex.<br></div></blockquote><div><br>=
</div><div>I&#39;m sure every proposal that added some functions to `basic_=
string` said the same thing. That kind of thinking is precisely how you get=
 bloated interfaces.</div><div><br></div><div>Those grains of seemingly irr=
elevant sand eventually add up to a desert.</div><div><br></div><div>That b=
eing said, I don&#39;t think `basic_string`&#39;s interface is <i>unnecessa=
rily</i> bloated. I find that (most of) those functions are essential, but =
mainly because there are no equivalent algorithms that can do those jobs an=
ywhere nearly as conveniently, clearly, and effectively.</div><div><br></di=
v><div>`str.find(&quot;foo&quot;sv)` is hundreds of times more digestible t=
han `auto look =3D &quot;foo&quot;sv; std::search(str.begin(), str.end(), l=
ook.begin(), look.end());` Range TS gives us `std::search(str, &quot;foo&qu=
ot;sv)`, which is pretty reasonable.<br></div></div></blockquote></span></d=
iv><span class=3D"gmail-">

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/9c62c391-1593-437d-b839-ce62472cf0ea%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/9c62=
c391-1593-437d-<wbr>b839-ce62472cf0ea%40isocpp.org</a><wbr>.<br>
</blockquote></div><br></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAANG%3DkVyVpTzS74BYKin6yEpvwh1AXCyS1=
sF53ck9i%2BJ%2BdvqMQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAANG%3DkVy=
VpTzS74BYKin6yEpvwh1AXCyS1sF53ck9i%2BJ%2BdvqMQ%40mail.gmail.com</a>.<br />

--00000000000017afa7056d07014a--

.


Author: "'Vlad from Moscow' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Fri, 25 May 2018 05:49:10 -0700 (PDT)
Raw View
------=_Part_13072_553323504.1527252550336
Content-Type: multipart/alternative;
 boundary="----=_Part_13073_2119791585.1527252550336"

------=_Part_13073_2119791585.1527252550336
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

I have not write yet a paper. I am just considering feedbacks for the=20
idea.:)

=D0=BF=D1=8F=D1=82=D0=BD=D0=B8=D1=86=D0=B0, 25 =D0=BC=D0=B0=D1=8F 2018 =D0=
=B3., 15:35:35 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82=
=D0=B5=D0=BB=D1=8C Ga=C5=A1per A=C5=BEman =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=
=B0=D0=BB:
>
> So, Vlad, are you writing a paper?
>
> G
>
> On Fri, May 25, 2018 at 1:22 PM, 'Vlad from Moscow' via ISO C++ Standard =
-=20
> Future Proposals <std-pr...@isocpp.org <javascript:>> wrote:
>
>> In fact most of the member functions that create a new representation of=
=20
>> the object of the class template std::basic_string have an overload that=
=20
>> uses iterators as for example assign, append, insert, replace, erase. An=
d=20
>> only the member function substr does not use iterators..
>>
>> =D1=87=D0=B5=D1=82=D0=B2=D0=B5=D1=80=D0=B3, 24 =D0=BC=D0=B0=D1=8F 2018 =
=D0=B3., 20:18:39 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=
=82=D0=B5=D0=BB=D1=8C Nicol Bolas =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=
=BB:
>>>
>>> On Thursday, May 24, 2018 at 11:28:32 AM UTC-4, Vlad from Moscow wrote:
>>>>
>>>> I do not think that adding the overloads of substr makes the class mor=
e=20
>>>> complex.
>>>>
>>>
>>> I'm sure every proposal that added some functions to `basic_string` sai=
d=20
>>> the same thing. That kind of thinking is precisely how you get bloated=
=20
>>> interfaces.
>>>
>>> Those grains of seemingly irrelevant sand eventually add up to a desert=
..
>>>
>>> That being said, I don't think `basic_string`'s interface is=20
>>> *unnecessarily* bloated. I find that (most of) those functions are=20
>>> essential, but mainly because there are no equivalent algorithms that c=
an=20
>>> do those jobs anywhere nearly as conveniently, clearly, and effectively=
..
>>>
>>> `str.find("foo"sv)` is hundreds of times more digestible than `auto loo=
k=20
>>> =3D "foo"sv; std::search(str.begin(), str.end(), look.begin(), look.end=
());`=20
>>> Range TS gives us `std::search(str, "foo"sv)`, which is pretty reasonab=
le.
>>>
>> --=20
>> You received this message because you are subscribed to the Google Group=
s=20
>> "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n=20
>> email to std-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> To view this discussion on the web visit=20
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/9c62c391-15=
93-437d-b839-ce62472cf0ea%40isocpp.org=20
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/9c62c391-1=
593-437d-b839-ce62472cf0ea%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoo=
ter>
>> .
>>
>
>

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/22524144-1998-4948-98ac-18239e4cb0b0%40isocpp.or=
g.

------=_Part_13073_2119791585.1527252550336
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">I have not write yet a paper. I am just considering feedba=
cks for the idea.:)<br><br>=D0=BF=D1=8F=D1=82=D0=BD=D0=B8=D1=86=D0=B0, 25 =
=D0=BC=D0=B0=D1=8F 2018 =D0=B3., 15:35:35 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=
=B7=D0=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Ga=C5=A1per A=C5=BEman =D0=BD=
=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<blockquote class=3D"gmail_quote" styl=
e=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left:=
 1ex;"><div dir=3D"ltr">So, Vlad, are you writing a paper?<div><br></div><d=
iv>G</div></div><div><br><div class=3D"gmail_quote">On Fri, May 25, 2018 at=
 1:22 PM, &#39;Vlad from Moscow&#39; via ISO C++ Standard - Future Proposal=
s <span dir=3D"ltr">&lt;<a href=3D"javascript:" target=3D"_blank" gdf-obfus=
cated-mailto=3D"xRnrcIycBQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&=
#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&=
#39;;return true;">std-pr...@isocpp.org</a>&gt;</span> wrote:<br><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex"><div dir=3D"ltr">In fact most of the member functions =
that create a new representation of the object of the class template std::b=
asic_string have an overload that uses iterators as for example assign, app=
end, insert, replace, erase. And only the member function substr does not u=
se iterators..<br><br>=D1=87=D0=B5=D1=82=D0=B2=D0=B5=D1=80=D0=B3, 24 =D0=BC=
=D0=B0=D1=8F 2018 =D0=B3., 20:18:39 UTC+3 =D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=
=BE=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8C Nicol Bolas =D0=BD=D0=B0=D0=BF=D0=
=B8=D1=81=D0=B0=D0=BB:<span><blockquote class=3D"gmail_quote" style=3D"marg=
in:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1e=
x"><div dir=3D"ltr">On Thursday, May 24, 2018 at 11:28:32 AM UTC-4, Vlad fr=
om Moscow wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0=
px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=
=3D"ltr">I do not think that adding the overloads of substr makes the class=
 more complex.<br></div></blockquote><div><br></div><div>I&#39;m sure every=
 proposal that added some functions to `basic_string` said the same thing. =
That kind of thinking is precisely how you get bloated interfaces.</div><di=
v><br></div><div>Those grains of seemingly irrelevant sand eventually add u=
p to a desert.</div><div><br></div><div>That being said, I don&#39;t think =
`basic_string`&#39;s interface is <i>unnecessarily</i> bloated. I find that=
 (most of) those functions are essential, but mainly because there are no e=
quivalent algorithms that can do those jobs anywhere nearly as conveniently=
, clearly, and effectively.</div><div><br></div><div>`str.find(&quot;foo&qu=
ot;sv)` is hundreds of times more digestible than `auto look =3D &quot;foo&=
quot;sv; std::search(str.begin(), str.end(), look.begin(), look.end());` Ra=
nge TS gives us `std::search(str, &quot;foo&quot;sv)`, which is pretty reas=
onable.<br></div></div></blockquote></span></div><span>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
xRnrcIycBQAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;javascript:&=
#39;;return true;" onclick=3D"this.href=3D&#39;javascript:&#39;;return true=
;">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"xRnrcIycBQAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D&#39;javascript:&#39;;return true;" onclick=3D"this.href=3D&#39=
;javascript:&#39;;return true;">std-pr...@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/9c62c391-1593-437d-b839-ce62472cf0ea%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter" target=3D"_blank" =
rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/9c62c391-1593-437d-b839-ce62472cf0ea%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" on=
click=3D"this.href=3D&#39;https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/9c62c391-1593-437d-b839-ce62472cf0ea%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/9c62c391-1593-437d-<wbr>b839-=
ce62472cf0ea%40isocpp.org</a><wbr>.<br>
</blockquote></div><br></div>
</blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&quot; group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/22524144-1998-4948-98ac-18239e4cb0b0%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/22524144-1998-4948-98ac-18239e4cb0b0=
%40isocpp.org</a>.<br />

------=_Part_13073_2119791585.1527252550336--

------=_Part_13072_553323504.1527252550336--

.