Topic: Add is_empty
Author: joewoodbury@gmail.com
Date: Tue, 12 Mar 2019 11:17:05 -0700 (PDT)
Raw View
------=_Part_2725_810856463.1552414625995
Content-Type: multipart/alternative;
boundary="----=_Part_2726_733138997.1552414625995"
------=_Part_2726_733138997.1552414625995
Content-Type: text/plain; charset="UTF-8"
The one thing that has irritated me the most with the standard library is
using ::empty() instead of ::is_empty(). Is there a possibility of adding
is_empty() to every class using empty()?
--
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/ee9b4876-3e40-417c-a460-347fa83871ce%40isocpp.org.
------=_Part_2726_733138997.1552414625995
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">The one thing that has irritated me the most with the stan=
dard library is using ::empty() instead of ::is_empty(). Is there a possibi=
lity of adding is_empty() to every class using empty()?<br></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/ee9b4876-3e40-417c-a460-347fa83871ce%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/ee9b4876-3e40-417c-a460-347fa83871ce=
%40isocpp.org</a>.<br />
------=_Part_2726_733138997.1552414625995--
------=_Part_2725_810856463.1552414625995--
.
Author: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Date: Tue, 12 Mar 2019 19:32:56 +0100
Raw View
Am Di., 12. M=C3=A4rz 2019 um 19:17 Uhr schrieb <joewoodbury@gmail.com>:
>
> The one thing that has irritated me the most with the standard library is=
using ::empty() instead of ::is_empty(). Is there a possibility of adding =
is_empty() to every class using empty()?
>
I don't consider that as a viable option:
1) An API that provides both "empty" and "is_empty" is confusing: Does
"empty" means something different? In addition: This is not really new
functionality, it is just selling existing functionality under a new
name.
2) Albeit the current Container requirements are actual tables that
are intended to simplify the Standard C++ Library specification, many
programmers in the world do consider them as kind of concepts and this
means that you break existing libraries providing a "Standard
Container" type which don't provide yet both empty() and is_empty()
3) Why should we modify a bunch of types in the standard, if we could
just provide a single _free_ function template? Problem is: We already
have such a single free function "empty" ;-)
My recommendation is: Why don't you define your own free function
template is_empty (similar to the free function "empty" as described
by (3)) that delegates either to std::empty() or that implements an
even simpler protocol (Such as that it participates in overload
resolution when x.empty() is valid for some const object x of type X)?
- Daniel
--=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/CAGNvRgCNM%2B4kcz2hXOKh-z_oRzvt6ehZN%3D_4J%3Dxmo=
D9CyBhO5w%40mail.gmail.com.
.
Author: Jake Arkinstall <jake.arkinstall@gmail.com>
Date: Tue, 12 Mar 2019 18:37:14 +0000
Raw View
--000000000000f97d0d0583e9fa94
Content-Type: text/plain; charset="UTF-8"
Agree that the current naming convention is dumb.
Disagree that adding a new method is a solution. If there's one thing
that's worse than a badly named method, it's multiple versions of the same
thing doing what they do best: confusing people.
On Tue, 12 Mar 2019, 18:17 , <joewoodbury@gmail.com> wrote:
> The one thing that has irritated me the most with the standard library is
> using ::empty() instead of ::is_empty(). Is there a possibility of adding
> is_empty() to every class using empty()?
>
> --
> 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/ee9b4876-3e40-417c-a460-347fa83871ce%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/ee9b4876-3e40-417c-a460-347fa83871ce%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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/CAC%2B0CCM9PZMV%2BRg1m_rjCA8UyBz6DvZ2kJXtsxE6DrufC5LA2g%40mail.gmail.com.
--000000000000f97d0d0583e9fa94
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto"><div>Agree that the current naming convention is dumb.<di=
v dir=3D"auto"><br></div><div dir=3D"auto">Disagree that adding a new metho=
d is a solution. If there's one thing that's worse than a badly nam=
ed method, it's multiple versions of the same thing doing what they do =
best: confusing people.</div><br><br><div class=3D"gmail_quote"><div dir=3D=
"ltr" class=3D"gmail_attr">On Tue, 12 Mar 2019, 18:17 , <<a href=3D"mail=
to:joewoodbury@gmail.com">joewoodbury@gmail.com</a>> wrote:<br></div><bl=
ockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #=
ccc solid;padding-left:1ex"><div dir=3D"ltr">The one thing that has irritat=
ed me the most with the standard library is using ::empty() instead of ::is=
_empty(). Is there a possibility of adding is_empty() to every class using =
empty()?<br></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank" rel=3D"noreferrer">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/ee9b4876-3e40-417c-a460-347fa83871ce%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank" =
rel=3D"noreferrer">https://groups.google.com/a/isocpp.org/d/msgid/std-propo=
sals/ee9b4876-3e40-417c-a460-347fa83871ce%40isocpp.org</a>.<br>
</blockquote></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/CAC%2B0CCM9PZMV%2BRg1m_rjCA8UyBz6DvZ2=
kJXtsxE6DrufC5LA2g%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCM9PZ=
MV%2BRg1m_rjCA8UyBz6DvZ2kJXtsxE6DrufC5LA2g%40mail.gmail.com</a>.<br />
--000000000000f97d0d0583e9fa94--
.
Author: joewoodbury@gmail.com
Date: Tue, 12 Mar 2019 11:59:15 -0700 (PDT)
Raw View
------=_Part_2631_1358075306.1552417155824
Content-Type: multipart/alternative;
boundary="----=_Part_2632_1541450773.1552417155824"
------=_Part_2632_1541450773.1552417155824
Content-Type: text/plain; charset="UTF-8"
I tend to agree for all but this case. FYI, see string::size() and
string::length()
On Tuesday, March 12, 2019 at 11:37:28 AM UTC-7, Jake Arkinstall wrote:
>
> Agree that the current naming convention is dumb.
>
> Disagree that adding a new method is a solution. If there's one thing
> that's worse than a badly named method, it's multiple versions of the same
> thing doing what they do best: confusing people.
>
>
> On Tue, 12 Mar 2019, 18:17 , <joewo...@gmail.com <javascript:>> wrote:
>
>> The one thing that has irritated me the most with the standard library is
>> using ::empty() instead of ::is_empty(). Is there a possibility of adding
>> is_empty() to every class using empty()?
>>
>> --
>> 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-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
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/ee9b4876-3e40-417c-a460-347fa83871ce%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/ee9b4876-3e40-417c-a460-347fa83871ce%40isocpp.org?utm_medium=email&utm_source=footer>
>> .
>>
>
--
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/4617eb7a-e272-4713-8a82-04f7a490cda4%40isocpp.org.
------=_Part_2632_1541450773.1552417155824
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I tend to agree for all but this case. FYI, see string::si=
ze() and string::length()<br><br>On Tuesday, March 12, 2019 at 11:37:28 AM =
UTC-7, Jake Arkinstall wrote:<blockquote class=3D"gmail_quote" style=3D"mar=
gin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><=
div dir=3D"auto"><div>Agree that the current naming convention is dumb.<div=
dir=3D"auto"><br></div><div dir=3D"auto">Disagree that adding a new method=
is a solution. If there's one thing that's worse than a badly name=
d method, it's multiple versions of the same thing doing what they do b=
est: confusing people.</div><br><br><div class=3D"gmail_quote"><div dir=3D"=
ltr">On Tue, 12 Mar 2019, 18:17 , <<a href=3D"javascript:" target=3D"_bl=
ank" gdf-obfuscated-mailto=3D"tXrHKyR0BAAJ" rel=3D"nofollow" onmousedown=3D=
"this.href=3D'javascript:';return true;" onclick=3D"this.href=3D=
9;javascript:';return true;">joewo...@gmail.com</a>> wrote:<br></div=
><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">The one thing that has irr=
itated me the most with the standard library is using ::empty() instead of =
::is_empty(). Is there a possibility of adding is_empty() to every class us=
ing empty()?<br></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" rel=3D"nofollow" target=3D"_blank" gdf-obfu=
scated-mailto=3D"tXrHKyR0BAAJ" onmousedown=3D"this.href=3D'javascript:&=
#39;;return true;" onclick=3D"this.href=3D'javascript:';return true=
;">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" rel=3D"nofollo=
w" target=3D"_blank" gdf-obfuscated-mailto=3D"tXrHKyR0BAAJ" onmousedown=3D"=
this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'=
;javascript:';return true;">std-pr...@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/ee9b4876-3e40-417c-a460-347fa83871ce%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank" onmousedown=3D"this.href=3D'https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/ee9b4876-3e40-417c-a460-347fa83871ce%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;" on=
click=3D"this.href=3D'https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/ee9b4876-3e40-417c-a460-347fa83871ce%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter';return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/ee9b4876-3e40-417c-<wbr>a460-=
347fa83871ce%40isocpp.org</a><wbr>.<br>
</blockquote></div></div></div>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" 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/4617eb7a-e272-4713-8a82-04f7a490cda4%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/4617eb7a-e272-4713-8a82-04f7a490cda4=
%40isocpp.org</a>.<br />
------=_Part_2632_1541450773.1552417155824--
------=_Part_2631_1358075306.1552417155824--
.
Author: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Date: Tue, 12 Mar 2019 20:03:42 +0100
Raw View
Am Di., 12. M=C3=A4rz 2019 um 19:59 Uhr schrieb <joewoodbury@gmail.com>:
>
> I tend to agree for all but this case. FYI, see string::size() and string=
::length()
This is a historical accident - and note that no other container
(except submatch) provides such a length function.
- Daniel
--=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/CAGNvRgDPCoO%2BNEP6HihrOiTFn9rAwrFGP0xBc-Vh6ec4a=
A60Ag%40mail.gmail.com.
.
Author: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Date: Tue, 12 Mar 2019 20:05:11 +0100
Raw View
Am Di., 12. M=C3=A4rz 2019 um 20:03 Uhr schrieb Daniel Kr=C3=BCgler
<daniel.kruegler@gmail.com>:
>
> Am Di., 12. M=C3=A4rz 2019 um 19:59 Uhr schrieb <joewoodbury@gmail.com>:
> >
> > I tend to agree for all but this case. FYI, see string::size() and stri=
ng::length()
>
> This is a historical accident - and note that no other container
> (except submatch) provides such a length function.
I meant match_results instead of submatch (submatch is no container)
> - Daniel
--=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/CAGNvRgCstd-mBr%2Bd0AjOiCcBBO%2Bco8UiLksMkpuWzzo=
pmi67Uw%40mail.gmail.com.
.