Topic: Re: [std-proposals] Enforce explicit casting on assi


Author: Thiago Macieira <thiago@macieira.org>
Date: Fri, 05 Oct 2018 22:06:05 -0700
Raw View
On Friday, 5 October 2018 18:48:32 PDT Johnny Shaw wrote:
> While there is value in implicit conversion under some circumstances.
> Explicit conversion clearly identifies the intent and eliminates mistakes.
> Enforcing a standard that requires explicit conversion to bool, at very
> least for a return value, will eliminate possible coding errors.

And break a lot of existing code. Because of that, you need to provide strong
justification why this should be adopted.

--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center



--
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/2016044.EC7RGCoeXV%40tjmaciei-mobl1.

.


Author: Johnny Shaw <johnnyshaw02@gmail.com>
Date: Sat, 6 Oct 2018 11:27:53 -0700 (PDT)
Raw View
------=_Part_1212_109004455.1538850473663
Content-Type: multipart/alternative;
 boundary="----=_Part_1213_69623676.1538850473663"

------=_Part_1213_69623676.1538850473663
Content-Type: text/plain; charset="UTF-8"

Fair point, I'll rephrase then.

*Define a standard for compiler warnings with respect to requiring explicit
conversions to bool.*

The use case here is type safety. One of the valuable things I appreciate
about C++ is the ability to clearly define your intent and ensure type safe
use.

The fact that Microsoft removing this compiler warning has *already *broken
some code out there (seen first hand). Therefor, it does feel like a step
backward - maybe I'm being naive. Yes, enforcing more standards around
compiler warnings might break some code out there from *compiling*. But, is
that a bad thing - wouldn't it be better to highlight when the developer is
making a mistake. And fix a bug at compile. Rather than deal with it at run
time.

In general, more standards around compiler warnings would benefit the
language in the long-run. Especially in the type-safety space, even if
those are optional warnings.

--
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/2eb36671-1f67-4f97-bc97-50bd9e81ba0b%40isocpp.org.

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

<div dir=3D"ltr">Fair point, I&#39;ll rephrase then.=C2=A0<div><br></div><d=
iv><i>Define a standard for compiler warnings with respect to requiring exp=
licit conversions to bool.</i></div><div><br></div><div>The use case here i=
s type safety. One of the valuable things I appreciate about C++ is the abi=
lity to clearly define your intent and ensure type safe use.</div><div><br>=
</div><div>The fact that Microsoft removing this compiler warning has <i>al=
ready </i>broken some code out there (seen first hand). Therefor, it does f=
eel like a step backward - maybe I&#39;m being naive. Yes, enforcing more s=
tandards around compiler warnings might break some code out there from <i>c=
ompiling</i>. But, is that a bad thing - wouldn&#39;t it be better to highl=
ight when the developer is making a mistake. And fix a bug at compile. Rath=
er than deal with it at run time.</div><div><br></div><div>In general, more=
 standards around compiler warnings would benefit the language in the long-=
run. Especially in the type-safety space, even if those are optional warnin=
gs.</div></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/2eb36671-1f67-4f97-bc97-50bd9e81ba0b%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/2eb36671-1f67-4f97-bc97-50bd9e81ba0b=
%40isocpp.org</a>.<br />

------=_Part_1213_69623676.1538850473663--

------=_Part_1212_109004455.1538850473663--

.


Author: Andrew Sandoval <sandoval@netwaysglobal.com>
Date: Sun, 7 Oct 2018 09:38:33 -0700 (PDT)
Raw View
------=_Part_1401_1623692797.1538930313905
Content-Type: multipart/alternative;
 boundary="----=_Part_1402_475993485.1538930313906"

------=_Part_1402_475993485.1538930313906
Content-Type: text/plain; charset="UTF-8"

On Saturday, October 6, 2018 at 12:06:08 AM UTC-5, Thiago Macieira wrote:
>
> On Friday, 5 October 2018 18:48:32 PDT Johnny Shaw wrote:
> > While there is value in implicit conversion under some circumstances.
> > Explicit conversion clearly identifies the intent and eliminates
> mistakes.
> > Enforcing a standard that requires explicit conversion to bool, at very
> > least for a return value, will eliminate possible coding errors.
>
> And break a lot of existing code. Because of that, you need to provide
> strong
> justification why this should be adopted.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>    Software Architect - Intel Open Source Technology Center
>

Thiago,

How does a compiler *warning *break any existing code?

Instead it is going to highlight poorly written code and common mistakes.

Keep in mind that things like Intellisense, though very helpful, also help
to introduce additional mistakes.  It is a very common thing that the IDE
supplies or completes the wrong variable, and the developer in a hurry
misses it, and then they return something that is NOT a bool for a function
that should return a bool.  A compile-time warning would save time, money,
and embarrassment.

Anything we do to improve the compiler's ability to catch mistakes makes
the language better.  And one of the selling points of C++ is type safety,
which is frankly fairly badly broken with regards to bool conversions.  It
is bad enough that I'm ready to start requiring (in reviews) code to use
enum class instead of bool, even if there are only two choices in the enum
-- because the compiler requires a static_cast to convert and enum class to
any other type, even if you specify a type (as in: enum class MyEnum :
unsigned int).

-Andrew Sandoval


--
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/8f3f409b-43ff-4834-a383-2a5b0c5dc66e%40isocpp.org.

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

<div dir=3D"ltr">On Saturday, October 6, 2018 at 12:06:08 AM UTC-5, Thiago =
Macieira wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">On Friday, 5 Oc=
tober 2018 18:48:32 PDT Johnny Shaw wrote:
<br>&gt; While there is value in implicit conversion under some circumstanc=
es.
<br>&gt; Explicit conversion clearly identifies the intent and eliminates m=
istakes.
<br>&gt; Enforcing a standard that requires explicit conversion to bool, at=
 very
<br>&gt; least for a return value, will eliminate possible coding errors.
<br>
<br>And break a lot of existing code. Because of that, you need to provide =
strong=20
<br>justification why this should be adopted.
<br>
<br>--=20
<br>Thiago Macieira - thiago (AT) <a href=3D"http://macieira.info" target=
=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.goo=
gle.com/url?q\x3dhttp%3A%2F%2Fmacieira.info\x26sa\x3dD\x26sntz\x3d1\x26usg\=
x3dAFQjCNEswDUBNCNanbu7euhqLn_62FW8ag&#39;;return true;" onclick=3D"this.hr=
ef=3D&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fmacieira.info\x26sa\x=
3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEswDUBNCNanbu7euhqLn_62FW8ag&#39;;return t=
rue;">macieira.info</a> - thiago (AT) <a href=3D"http://kde.org" target=3D"=
_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&#39;http://www.google.=
com/url?q\x3dhttp%3A%2F%2Fkde.org\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNH=
GRJdo5_JYG1DowztwAHAKs80XSA&#39;;return true;" onclick=3D"this.href=3D&#39;=
http://www.google.com/url?q\x3dhttp%3A%2F%2Fkde.org\x26sa\x3dD\x26sntz\x3d1=
\x26usg\x3dAFQjCNHGRJdo5_JYG1DowztwAHAKs80XSA&#39;;return true;">kde.org</a=
>
<br>=C2=A0 =C2=A0Software Architect - Intel Open Source Technology Center
<br></blockquote><div><br></div><div>Thiago,</div><div><br></div><div>How d=
oes a compiler <i><b>warning </b></i>break any existing code?</div><div><br=
></div><div>Instead it is going to highlight poorly written code and common=
 mistakes.</div><div><br></div><div>Keep in mind that things like Intellise=
nse, though very helpful, also help to introduce additional mistakes.=C2=A0=
 It is a very common thing that the IDE supplies or completes the wrong var=
iable, and the developer in a hurry misses it, and then they return somethi=
ng that is NOT a bool for a function that should return a bool.=C2=A0 A com=
pile-time warning would save time, money, and embarrassment.</div><div><br>=
</div><div>Anything we do to improve the compiler&#39;s ability to catch mi=
stakes makes the language better.=C2=A0 And one of the selling points of C+=
+ is type safety, which is frankly fairly badly broken with regards to bool=
 conversions.=C2=A0 It is bad enough that I&#39;m ready to start requiring =
(in reviews) code to use enum class instead of bool, even if there are only=
 two choices in the enum -- because the compiler requires a static_cast to =
convert and enum class to any other type, even if you specify a type (as in=
: enum class MyEnum : unsigned int).</div><div><br></div><div>-Andrew Sando=
val</div><div>=C2=A0</div></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/8f3f409b-43ff-4834-a383-2a5b0c5dc66e%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/8f3f409b-43ff-4834-a383-2a5b0c5dc66e=
%40isocpp.org</a>.<br />

------=_Part_1402_475993485.1538930313906--

------=_Part_1401_1623692797.1538930313905--

.


Author: Ville Voutilainen <ville.voutilainen@gmail.com>
Date: Sun, 7 Oct 2018 20:04:57 +0300
Raw View
On Sun, 7 Oct 2018 at 19:38, Andrew Sandoval <sandoval@netwaysglobal.com> w=
rote:
>
> On Saturday, October 6, 2018 at 12:06:08 AM UTC-5, Thiago Macieira wrote:
>>
>> On Friday, 5 October 2018 18:48:32 PDT Johnny Shaw wrote:
>> > While there is value in implicit conversion under some circumstances.
>> > Explicit conversion clearly identifies the intent and eliminates mista=
kes.
>> > Enforcing a standard that requires explicit conversion to bool, at ver=
y
>> > least for a return value, will eliminate possible coding errors.
>>
>> And break a lot of existing code. Because of that, you need to provide s=
trong
>> justification why this should be adopted.
>>
>> --
>> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>>    Software Architect - Intel Open Source Technology Center
>
>
> Thiago,
>
> How does a compiler warning break any existing code?

Very easily, this happens on every major compiler release. A compiler
adds a new warning, enables it under warning flags
that users already use, and -Werror does the rest.

> Instead it is going to highlight poorly written code and common mistakes.

And break valid code that has nothing wrong in it.

> Keep in mind that things like Intellisense, though very helpful, also hel=
p to introduce additional mistakes.  It is a very common thing that the IDE=
 supplies or completes the wrong variable, and the developer in a hurry mis=
ses it, and then they return something that is NOT a bool for a function th=
at should return a bool.  A compile-time warning would save time, money, an=
d embarrassment.
>
> Anything we do to improve the compiler's ability to catch mistakes makes =
the language better.  And one of the selling points of C++ is type safety, =
which is frankly fairly badly broken with regards to bool conversions.  It =
is bad enough that I'm ready to start requiring (in reviews) code to use en=
um class instead of bool, even if there are only two choices in the enum --=
 because the compiler requires a static_cast to convert and enum class to a=
ny other type, even if you specify a type (as in: enum class MyEnum : unsig=
ned int).

Great, then you don't need a language change.

--=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/CAFk2RUYRWakHS805tNXUnUr71t7%2BBOOAOHaFdXk_oyfa3=
40Vvg%40mail.gmail.com.

.


Author: Thiago Macieira <thiago@macieira.org>
Date: Sun, 07 Oct 2018 10:54:50 -0700
Raw View
On Sunday, 7 October 2018 09:38:33 PDT Andrew Sandoval wrote:
> On Saturday, October 6, 2018 at 12:06:08 AM UTC-5, Thiago Macieira wrote:
> > On Friday, 5 October 2018 18:48:32 PDT Johnny Shaw wrote:
> > > While there is value in implicit conversion under some circumstances.
> > > Explicit conversion clearly identifies the intent and eliminates
> >
> > mistakes.
> >
> > > Enforcing a standard that requires explicit conversion to bool, at very
> > > least for a return value, will eliminate possible coding errors.
> >
> > And break a lot of existing code. Because of that, you need to provide
> > strong
> > justification why this should be adopted.
>
> Thiago,
>
> How does a compiler *warning *break any existing code?

We've never dealt with warnings in this mailing list, since the standard
doesn't deal with them either. I missed the fact that the original email was
asking for warnings and assumed it was talking about syntax changes.

> Instead it is going to highlight poorly written code and common mistakes.

Nothing wrong with that in warnings. But warnings need to be sensible and I am
not sure this case counts as either poorly-written or a common mistake. Yes,
there may be instances of the cast being unintentional. What remains to be
seen is whether the ratio is high enough to justify annoying everyone else who
got it right with a warning.

Otherwise, it would go to the books as an annoyance to everywhere where it was
already right, like the GCC warning on
 if (a && b || c)

> Keep in mind that things like Intellisense, though very helpful, also help
> to introduce additional mistakes.  It is a very common thing that the IDE
> supplies or completes the wrong variable, and the developer in a hurry
> misses it, and then they return something that is NOT a bool for a function
> that should return a bool.  A compile-time warning would save time, money,
> and embarrassment.

And returning something that is not a bool in a function that returns bool is
often the exact thing that was intended. Some thing like:

 bool isValid() { return size; }
or
 bool isValid() { return ptr; }

A cast to bool or a double-bang could help with making it absolutely clear
that it was intended and not a mistake, but my point is that the code above is
already right. Adding a warning means annoying the developers who wrote that
code and quite often everyone using it.

> Anything we do to improve the compiler's ability to catch mistakes makes
> the language better.

Not everything. This needs to be weighed against the side effects, whether
intentional or not.

> And one of the selling points of C++ is type safety,
> which is frankly fairly badly broken with regards to bool conversions.  It
> is bad enough that I'm ready to start requiring (in reviews) code to use
> enum class instead of bool, even if there are only two choices in the enum
> -- because the compiler requires a static_cast to convert and enum class to
> any other type, even if you specify a type (as in: enum class MyEnum :
> unsigned int).

--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center



--
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/1700149.ojBUBa6pdX%40tjmaciei-mobl1.

.


Author: gmisocpp@gmail.com
Date: Sun, 7 Oct 2018 19:29:40 -0700 (PDT)
Raw View
------=_Part_1212_941134869.1538965780256
Content-Type: multipart/alternative;
 boundary="----=_Part_1213_798239308.1538965780257"

------=_Part_1213_798239308.1538965780257
Content-Type: text/plain; charset="UTF-8"


>
>
> And returning something that is not a bool in a function that returns bool
> is
> often the exact thing that was intended. Some thing like:
>
>         bool isValid()        { return size; }
> or
>         bool isValid()        { return ptr; }
>
> A cast to bool or a double-bang could help with making it absolutely clear
> that it was intended and not a mistake, but my point is that the code
> above is
> already right. Adding a warning means annoying the developers who wrote
> that
> code and quite often everyone using it.
>

I think this kind of code should be warned on by default on all compilers
and I'd be happy if the Standard mandated that It generated warnings by
default.
If people want to write such code they should be forced to use some warning
disable switch for that case and wrestle with the non standard realities of
using that switch but by default I'd like all compilers to encourage better
code for the cases you have outlined here.


--
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/32c0cd10-426c-41b5-b80d-6ef300877950%40isocpp.org.

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

<div dir=3D"ltr"><blockquote class=3D"gmail_quote" style=3D"margin: 0px 0px=
 0px 0.8ex; padding-left: 1ex; border-left-color: rgb(204, 204, 204); borde=
r-left-width: 1px; border-left-style: solid;"><br>And returning something t=
hat is not a bool in a function that returns bool is=20
<br>often the exact thing that was intended. Some thing like:
<br>
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0bool isValid()=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0{ return size; }
<br>or
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0bool isValid()=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0{ return ptr; }
<br>
<br>A cast to bool or a double-bang could help with making it absolutely cl=
ear=20
<br>that it was intended and not a mistake, but my point is that the code a=
bove is=20
<br>already right. Adding a warning means annoying the developers who wrote=
 that=20
<br>code and quite often everyone using it.
<br>
</blockquote><div><br></div><div>I think this kind of code should be warned=
 on by default on all compilers and I&#39;d be happy if the Standard mandat=
ed that It generated warnings by default.</div><div>If people want to write=
 such code they should be forced to use some=C2=A0warning disable switch fo=
r that case and wrestle with the non standard realities of using that switc=
h but by default I&#39;d like all=C2=A0compilers to=C2=A0encourage better c=
ode for the cases you have outlined here.</div><div>=C2=A0</div></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/32c0cd10-426c-41b5-b80d-6ef300877950%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/32c0cd10-426c-41b5-b80d-6ef300877950=
%40isocpp.org</a>.<br />

------=_Part_1213_798239308.1538965780257--

------=_Part_1212_941134869.1538965780256--

.


Author: Thiago Macieira <thiago@macieira.org>
Date: Sun, 07 Oct 2018 22:16:13 -0700
Raw View
On Sunday, 7 October 2018 19:29:40 PDT gmisocpp@gmail.com wrote:
> I think this kind of code should be warned on by default on all compilers
> and I'd be happy if the Standard mandated that It generated warnings by
> default.
> If people want to write such code they should be forced to use some warning
> disable switch for that case and wrestle with the non standard realities of
> using that switch but by default I'd like all compilers to encourage better
> code for the cases you have outlined here.

That is not the standard.

But it could be a side document produced by a workgroup that specialises on
suggestions to compiler developers on what to warn to improve code quality.

--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center



--
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/35795654.8VK5JdQRua%40tjmaciei-mobl1.

.


Author: olaf@join.cc
Date: Mon, 8 Oct 2018 02:15:45 -0700 (PDT)
Raw View
------=_Part_1550_734513812.1538990145477
Content-Type: multipart/alternative;
 boundary="----=_Part_1551_270981623.1538990145477"

------=_Part_1551_270981623.1538990145477
Content-Type: text/plain; charset="UTF-8"



Op maandag 8 oktober 2018 04:29:40 UTC+2 schreef gmis...@gmail.com:
>
>
>> And returning something that is not a bool in a function that returns
>> bool is
>> often the exact thing that was intended. Some thing like:
>>
>>         bool isValid()        { return size; }
>> or
>>         bool isValid()        { return ptr; }
>>
>> A cast to bool or a double-bang could help with making it absolutely
>> clear
>> that it was intended and not a mistake, but my point is that the code
>> above is
>> already right. Adding a warning means annoying the developers who wrote
>> that
>> code and quite often everyone using it.
>>
>
> I think this kind of code should be warned on by default on all compilers
> and I'd be happy if the Standard mandated that It generated warnings by
> default.
> If people want to write such code they should be forced to use
> some warning disable switch for that case and wrestle with the non standard
> realities of using that switch but by default I'd like all compilers
> to encourage better code for the cases you have outlined here.
>
>

Other people think this kind of code should NOT be warned on by default on
all compilers and would be unhappy if the Standard mandated so..

--
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/aafc44ae-9ca6-4ce2-9247-a992b4256a42%40isocpp.org.

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

<div dir=3D"ltr"><br><br>Op maandag 8 oktober 2018 04:29:40 UTC+2 schreef g=
mis...@gmail.com:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;pad=
ding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;bord=
er-left-style:solid"><br>And returning something that is not a bool in a fu=
nction that returns bool is=20
<br>often the exact thing that was intended. Some thing like:
<br>
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0bool isValid()=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0{ return size; }
<br>or
<br>=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0bool isValid()=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0{ return ptr; }
<br>
<br>A cast to bool or a double-bang could help with making it absolutely cl=
ear=20
<br>that it was intended and not a mistake, but my point is that the code a=
bove is=20
<br>already right. Adding a warning means annoying the developers who wrote=
 that=20
<br>code and quite often everyone using it.
<br>
</blockquote><div><br></div><div>I think this kind of code should be warned=
 on by default on all compilers and I&#39;d be happy if the Standard mandat=
ed that It generated warnings by default.</div><div>If people want to write=
 such code they should be forced to use some=C2=A0warning disable switch fo=
r that case and wrestle with the non standard realities of using that switc=
h but by default I&#39;d like all=C2=A0compilers to=C2=A0encourage better c=
ode for the cases you have outlined here.</div><div>=C2=A0</div></div></blo=
ckquote><div><br></div><div>Other people think this kind of code should NOT=
 be warned on by default on all compilers and would be unhappy if the Stand=
ard mandated so..=C2=A0</div></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/aafc44ae-9ca6-4ce2-9247-a992b4256a42%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/aafc44ae-9ca6-4ce2-9247-a992b4256a42=
%40isocpp.org</a>.<br />

------=_Part_1551_270981623.1538990145477--

------=_Part_1550_734513812.1538990145477--

.


Author: Andrew Sandoval <sandoval@netwaysglobal.com>
Date: Mon, 8 Oct 2018 10:30:52 -0700
Raw View
--0000000000004a72bf0577bafc95
Content-Type: text/plain; charset="UTF-8"

On Sun, Oct 7, 2018 at 10:05 AM Ville Voutilainen <
ville.voutilainen@gmail.com> wrote:

> On Sun, 7 Oct 2018 at 19:38, Andrew Sandoval <sandoval@netwaysglobal.com>
> wrote:
> >
> > On Saturday, October 6, 2018 at 12:06:08 AM UTC-5, Thiago Macieira wrote:
> >>
> >> On Friday, 5 October 2018 18:48:32 PDT Johnny Shaw wrote:
> >> > While there is value in implicit conversion under some circumstances.
> >> > Explicit conversion clearly identifies the intent and eliminates
> mistakes.
> >> > Enforcing a standard that requires explicit conversion to bool, at
> very
> >> > least for a return value, will eliminate possible coding errors.
> >>
> >> And break a lot of existing code. Because of that, you need to provide
> strong
> >> justification why this should be adopted.
> >>
> >> --
> >> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
> >>    Software Architect - Intel Open Source Technology Center
> >
> >
> > Thiago,
> >
> > How does a compiler warning break any existing code?
>
> Very easily, this happens on every major compiler release. A compiler
> adds a new warning, enables it under warning flags
> that users already use, and -Werror does the rest.
>
> Ville, of course that is true -- we just saw things break in Visual Studio
2017 due to changes around the register and inline keywords.  And frankly,
I'm not trying to pick a battle with you or anyone else here -- I know you
contribute greatly to C++, but let's be honest...  A *warning* doesn't
break the code.  A *warning* doesn't "break" anything -- it just warns.
And in so doing, it provides us opportunities to re-examine old code to see
if the warning is warrants changes that might fix real bugs or
vulnerabilities.

Anyway, there is no point arguing the semantics of the word "break".  I
really wasn't intended that, just backing up what has been said on the
topic, because I have seen where a warning on bool conversion would have
saved time and therefore money.  And I appreciate very much Thaigo's
response to my questions.


> > Instead it is going to highlight poorly written code and common mistakes.
>
> And break valid code that has nothing wrong in it.
>
> > Keep in mind that things like Intellisense, though very helpful, also
> help to introduce additional mistakes.  It is a very common thing that the
> IDE supplies or completes the wrong variable, and the developer in a hurry
> misses it, and then they return something that is NOT a bool for a function
> that should return a bool.  A compile-time warning would save time, money,
> and embarrassment.
> >
> > Anything we do to improve the compiler's ability to catch mistakes makes
> the language better.  And one of the selling points of C++ is type safety,
> which is frankly fairly badly broken with regards to bool conversions.  It
> is bad enough that I'm ready to start requiring (in reviews) code to use
> enum class instead of bool, even if there are only two choices in the enum
> -- because the compiler requires a static_cast to convert and enum class to
> any other type, even if you specify a type (as in: enum class MyEnum :
> unsigned int).
>
> Great, then you don't need a language change.
>
Sure, there are alternatives, and I can make rules around the code base I
am responsible for, but that is kind of heartless to everyone else who has
to suffer from common mistakes that we could have the compilers catch.
Besides, I think the reason Johnny brought this up was as a "proposal" for
discussion, not a mandate to you or anyone else.  If you can find fault
with the suggestion, or argue that mistakes could not be prevented by
either recommending a warning, or requiring a cast (e.g. static_cast) on
bool conversions, then please do so.  You know some of the more intricate
details of the language that may elude the rest of us, and your insights
would be far more valuable than curt responses.  If I seemed to deserve
that response, then you have my apology for provoking it.

Thanks,
Andrew Sandoval

--
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/CAJEeERW_JOmR6JBfrU9cTgVi2Jt_T%3D7BeK07NWoOuLOADPUxhQ%40mail.gmail.com.

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

<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Sun, Oct 7,=
 2018 at 10:05 AM Ville Voutilainen &lt;<a href=3D"mailto:ville.voutilainen=
@gmail.com">ville.voutilainen@gmail.com</a>&gt; wrote:<br></div><blockquote=
 class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli=
d;padding-left:1ex">On Sun, 7 Oct 2018 at 19:38, Andrew Sandoval &lt;<a hre=
f=3D"mailto:sandoval@netwaysglobal.com" target=3D"_blank">sandoval@netwaysg=
lobal.com</a>&gt; wrote:<br>
&gt;<br>
&gt; On Saturday, October 6, 2018 at 12:06:08 AM UTC-5, Thiago Macieira wro=
te:<br>
&gt;&gt;<br>
&gt;&gt; On Friday, 5 October 2018 18:48:32 PDT Johnny Shaw wrote:<br>
&gt;&gt; &gt; While there is value in implicit conversion under some circum=
stances.<br>
&gt;&gt; &gt; Explicit conversion clearly identifies the intent and elimina=
tes mistakes.<br>
&gt;&gt; &gt; Enforcing a standard that requires explicit conversion to boo=
l, at very<br>
&gt;&gt; &gt; least for a return value, will eliminate possible coding erro=
rs.<br>
&gt;&gt;<br>
&gt;&gt; And break a lot of existing code. Because of that, you need to pro=
vide strong<br>
&gt;&gt; justification why this should be adopted.<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Thiago Macieira - thiago (AT) <a href=3D"http://macieira.info" rel=
=3D"noreferrer" target=3D"_blank">macieira.info</a> - thiago (AT) <a href=
=3D"http://kde.org" rel=3D"noreferrer" target=3D"_blank">kde.org</a><br>
&gt;&gt;=C2=A0 =C2=A0 Software Architect - Intel Open Source Technology Cen=
ter<br>
&gt;<br>
&gt;<br>
&gt; Thiago,<br>
&gt;<br>
&gt; How does a compiler warning break any existing code?<br>
<br>
Very easily, this happens on every major compiler release. A compiler<br>
adds a new warning, enables it under warning flags<br>
that users already use, and -Werror does the rest.<br>
<br></blockquote><div>Ville, of course that is true -- we just saw things b=
reak in Visual Studio 2017 due to changes around the register and inline ke=
ywords.=C2=A0 And frankly, I&#39;m not trying to pick a battle with you or =
anyone else here -- I know you contribute greatly to C++, but let&#39;s be =
honest...=C2=A0 A <i>warning</i>=C2=A0doesn&#39;t break the code.=C2=A0 A <=
i>warning</i>=C2=A0doesn&#39;t &quot;break&quot; anything -- it just warns.=
=C2=A0 And in so doing, it provides us opportunities to re-examine old code=
 to see if the warning is warrants changes that might fix real bugs or vuln=
erabilities.</div><div><br></div><div>Anyway, there is no point arguing the=
 semantics of the word &quot;break&quot;.=C2=A0 I really wasn&#39;t intende=
d that, just backing up what has been said on the topic, because I have see=
n where a warning on bool conversion would have saved time and therefore mo=
ney.=C2=A0 And I appreciate very much Thaigo&#39;s response to my questions=
..</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0=
 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
&gt; Instead it is going to highlight poorly written code and common mistak=
es.<br>
<br>
And break valid code that has nothing wrong in it.<br>
<br>
&gt; Keep in mind that things like Intellisense, though very helpful, also =
help to introduce additional mistakes.=C2=A0 It is a very common thing that=
 the IDE supplies or completes the wrong variable, and the developer in a h=
urry misses it, and then they return something that is NOT a bool for a fun=
ction that should return a bool.=C2=A0 A compile-time warning would save ti=
me, money, and embarrassment.<br>
&gt;<br>
&gt; Anything we do to improve the compiler&#39;s ability to catch mistakes=
 makes the language better.=C2=A0 And one of the selling points of C++ is t=
ype safety, which is frankly fairly badly broken with regards to bool conve=
rsions.=C2=A0 It is bad enough that I&#39;m ready to start requiring (in re=
views) code to use enum class instead of bool, even if there are only two c=
hoices in the enum -- because the compiler requires a static_cast to conver=
t and enum class to any other type, even if you specify a type (as in: enum=
 class MyEnum : unsigned int).<br>
<br>
Great, then you don&#39;t need a language change.<br></blockquote><div>Sure=
, there are alternatives, and I can make rules around the code base I am re=
sponsible for, but that is kind of heartless to everyone else who has to su=
ffer from common mistakes that we could have the compilers catch.=C2=A0 Bes=
ides, I think the reason Johnny brought this up was as a &quot;proposal&quo=
t; for discussion, not a mandate to you or anyone else.=C2=A0 If you can fi=
nd fault with the suggestion, or argue that mistakes could not be prevented=
 by either recommending a warning, or requiring a cast (e.g. static_cast) o=
n bool conversions, then please do so.=C2=A0 You know some of the more intr=
icate details of the language that may elude the rest of us, and your insig=
hts would be far more valuable than curt responses.=C2=A0 If I seemed to de=
serve that response, then you have my apology for provoking it.</div><div><=
br></div><div>Thanks,</div><div>Andrew Sandoval</div></div></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/CAJEeERW_JOmR6JBfrU9cTgVi2Jt_T%3D7BeK=
07NWoOuLOADPUxhQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAJEeERW_JOmR6J=
BfrU9cTgVi2Jt_T%3D7BeK07NWoOuLOADPUxhQ%40mail.gmail.com</a>.<br />

--0000000000004a72bf0577bafc95--

.


Author: Dilip Ranganathan <misc.usage@gmail.com>
Date: Mon, 8 Oct 2018 13:36:00 -0400
Raw View
--000000000000a14a910577bb0ea2
Content-Type: text/plain; charset="UTF-8"

On Mon, Oct 8, 2018 at 1:31 PM Andrew Sandoval <sandoval@netwaysglobal.com>
wrote:

> You know some of the more intricate details of the language that may elude
> the rest of us, and your insights would be far more valuable than curt
> responses.  If I seemed to deserve that response, then you have my apology
> for provoking it.
>

Clearly you haven't been at the business end of Mr. Nicol Bolas'
suggestions yet :-)
Speaking of which, I haven't seen him posting all that much lately.

--
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/CALEPxfsiiSZ9NG8YBt%2BB5QkGNjrBAOnjRcZLmNLtBW3Naa96JA%40mail.gmail.com.

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

<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Mon, Oct 8,=
 2018 at 1:31 PM Andrew Sandoval &lt;<a href=3D"mailto:sandoval@netwaysglob=
al.com">sandoval@netwaysglobal.com</a>&gt; wrote:<br></div><blockquote clas=
s=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pad=
ding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr"=
>You know some of the more intricate details of the language that may elude=
 the rest of us, and your insights would be far more valuable than curt res=
ponses.=C2=A0 If I seemed to deserve that response, then you have my apolog=
y for provoking it.<br></div></div></div></blockquote><div><br></div><div>C=
learly you haven&#39;t been at the business end of Mr. Nicol Bolas&#39; sug=
gestions yet :-)</div><div>Speaking of which, I haven&#39;t seen him postin=
g all that much lately.</div></div></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/CALEPxfsiiSZ9NG8YBt%2BB5QkGNjrBAOnjRc=
ZLmNLtBW3Naa96JA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CALEPxfsiiSZ9NG=
8YBt%2BB5QkGNjrBAOnjRcZLmNLtBW3Naa96JA%40mail.gmail.com</a>.<br />

--000000000000a14a910577bb0ea2--

.


Author: Hyman Rosen <hyman.rosen@gmail.com>
Date: Mon, 8 Oct 2018 13:39:29 -0400
Raw View
--0000000000002052ad0577bb1b80
Content-Type: text/plain; charset="UTF-8"

On Mon, Oct 8, 2018 at 1:36 PM Dilip Ranganathan <misc.usage@gmail.com>
wrote:

> Clearly you haven't been at the business end of Mr. Nicol Bolas'
> suggestions yet :-)
> Speaking of which, I haven't seen him posting all that much lately.
>

He's busy plotting the conquest of Ravnica :-)
<
https://shop.tcgplayer.com/magic/guilds-of-ravnica-mythic-edition/nicol-bolas-planeswalker
>

--
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/CAHSYqdbh%2BiKYq6jz5G840VTnR9KJC4z6tu%3DgHkOkko1qU4ag9g%40mail.gmail.com.

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

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div class=3D"gmail_quot=
e"><div dir=3D"ltr">On Mon, Oct 8, 2018 at 1:36 PM Dilip Ranganathan &lt;<a=
 href=3D"mailto:misc.usage@gmail.com" target=3D"_blank">misc.usage@gmail.co=
m</a>&gt; wrote:</div><blockquote class=3D"gmail_quote" style=3D"margin:0px=
 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><di=
v dir=3D"ltr"><div class=3D"gmail_quote"><div>Clearly you haven&#39;t been =
at the business end of Mr. Nicol Bolas&#39; suggestions yet :-)</div><div>S=
peaking of which, I haven&#39;t seen him posting all that much lately.</div=
></div></div></blockquote><div><br></div><div>He&#39;s busy plotting the co=
nquest of Ravnica :-)<br>&lt;<a href=3D"https://shop.tcgplayer.com/magic/gu=
ilds-of-ravnica-mythic-edition/nicol-bolas-planeswalker">https://shop.tcgpl=
ayer.com/magic/guilds-of-ravnica-mythic-edition/nicol-bolas-planeswalker</a=
>&gt;</div></div></div></div></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/CAHSYqdbh%2BiKYq6jz5G840VTnR9KJC4z6tu=
%3DgHkOkko1qU4ag9g%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdbh%2Bi=
KYq6jz5G840VTnR9KJC4z6tu%3DgHkOkko1qU4ag9g%40mail.gmail.com</a>.<br />

--0000000000002052ad0577bb1b80--

.


Author: Andrew Sandoval <sandoval@netwaysglobal.com>
Date: Mon, 8 Oct 2018 10:40:36 -0700
Raw View
--00000000000017d2d80577bb1fb7
Content-Type: text/plain; charset="UTF-8"

On Mon, Oct 8, 2018 at 2:15 AM <olaf@join.cc> wrote:

>
>
> Other people think this kind of code should NOT be warned on by default on
> all compilers and would be unhappy if the Standard mandated so..
>
> Olaf, can you elaborate on the reasons why this would be a problem for
"other people"?  And is there any good reason why the Standard should not
make strong recommendations on warning -- or at least on optional warnings
and maybe why someone would choose to enable or disable them.

I can argue that the current automatic / implicit conversion violates type
safety.  The only argument so far that I've seen for implicit conversion of
bool is because there is some existing code that would break if it
changed.  I'm interested in knowing *if *I am being naive about this how
so, because I know perfectly well from past experiences that there is a
vast pool of knowledge here that we can learn from.

Thanks,
Andrew Sandoval

--
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/CAJEeERWQ5Tvj%2B0RBsMenanU7VngUMgQ5_ehF%3DMLVrj%2BTR1JiQg%40mail.gmail.com.

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

<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Mon, Oct 8,=
 2018 at 2:15 AM &lt;olaf@join.cc&gt; wrote:<br></div><blockquote class=3D"=
gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-=
left:1ex"><div dir=3D"ltr"><br><div><br></div><div>Other people think this =
kind of code should NOT be warned on by default on all compilers and would =
be unhappy if the Standard mandated so..=C2=A0</div></div>

<p></p></blockquote></div><div class=3D"gmail_signature" data-smartmail=3D"=
gmail_signature">Olaf, can you elaborate on the reasons why this would be a=
 problem for &quot;other people&quot;?=C2=A0 And is there any good reason w=
hy the Standard should not make strong recommendations on warning -- or at =
least on optional warnings and maybe why someone would choose to enable or =
disable them.</div><div class=3D"gmail_signature" data-smartmail=3D"gmail_s=
ignature"><br></div><div class=3D"gmail_signature" data-smartmail=3D"gmail_=
signature">I can argue that the current automatic / implicit conversion vio=
lates type safety.=C2=A0 The only argument so far that I&#39;ve seen for im=
plicit conversion of bool is because there is some existing code that would=
 break if it changed.=C2=A0 I&#39;m interested in knowing <i>if </i>I am be=
ing naive about this how so, because I know perfectly well from past experi=
ences that there is a vast pool of knowledge here that we can learn from.</=
div><div class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><br><=
/div><div class=3D"gmail_signature" data-smartmail=3D"gmail_signature">Than=
ks,</div><div class=3D"gmail_signature" data-smartmail=3D"gmail_signature">=
Andrew Sandoval</div></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/CAJEeERWQ5Tvj%2B0RBsMenanU7VngUMgQ5_e=
hF%3DMLVrj%2BTR1JiQg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAJEeERWQ5T=
vj%2B0RBsMenanU7VngUMgQ5_ehF%3DMLVrj%2BTR1JiQg%40mail.gmail.com</a>.<br />

--00000000000017d2d80577bb1fb7--

.


Author: Hyman Rosen <hyman.rosen@gmail.com>
Date: Mon, 8 Oct 2018 13:43:40 -0400
Raw View
--0000000000000a0c040577bb2ac6
Content-Type: text/plain; charset="UTF-8"

On Sun, Oct 7, 2018 at 1:05 PM Ville Voutilainen <
ville.voutilainen@gmail.com> wrote:

> On Sun, 7 Oct 2018 at 19:38, Andrew Sandoval <sandoval@netwaysglobal.com>
> wrote:
> > How does a compiler warning break any existing code?
>
> Very easily, this happens on every major compiler release. A compiler
> adds a new warning, enables it under warning flags
> that users already use, and -Werror does the rest.
>

If people build using -Werror then they are not programming in C++, but in
some
subset language arbitrarily determined by their implementor.  Why should a
group
devoted to Standard C++ care about people who program in a different
language?

--
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/CAHSYqdaL1J5LquRO9MiWrF0PydGNshF1xvV6O60mu_%3DPKxz9Sg%40mail.gmail.com.

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

<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Sun, Oct 7,=
 2018 at 1:05 PM Ville Voutilainen &lt;<a href=3D"mailto:ville.voutilainen@=
gmail.com">ville.voutilainen@gmail.com</a>&gt; wrote:<br></div><blockquote =
class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid=
;padding-left:1ex">On Sun, 7 Oct 2018 at 19:38, Andrew Sandoval &lt;<a href=
=3D"mailto:sandoval@netwaysglobal.com" target=3D"_blank">sandoval@netwaysgl=
obal.com</a>&gt; wrote:<br>
&gt; How does a compiler warning break any existing code?<br>
<br>
Very easily, this happens on every major compiler release. A compiler<br>
adds a new warning, enables it under warning flags<br>
that users already use, and -Werror does the rest.<br></blockquote><div><br=
>If people build using -Werror then they are not programming in C++, but in=
 some<br>subset language arbitrarily determined by their implementor.=C2=A0=
 Why should a group<br>devoted to Standard C++ care about people who progra=
m in a different language?</div></div></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/CAHSYqdaL1J5LquRO9MiWrF0PydGNshF1xvV6=
O60mu_%3DPKxz9Sg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdaL1J5Lqu=
RO9MiWrF0PydGNshF1xvV6O60mu_%3DPKxz9Sg%40mail.gmail.com</a>.<br />

--0000000000000a0c040577bb2ac6--

.


Author: "'Alisdair Meredith' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Mon, 08 Oct 2018 13:55:15 -0400
Raw View
--Apple-Mail-C2861EA1-2964-47E6-978E-2A0234A1B5AC
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

This is why explicit conversion operators were introduced in C++11, if they=
 were already mentioned in this thread, then sorry, I missed them.

Once we have the ability to mark a conversion as explicit, then we are left=
 with the question of how the language forms a conversion when one is neede=
d, such as the predicate in an =E2=80=98if=E2=80=99.  Is the language formi=
ng an explicit conversion to =E2=80=98bool=E2=80=99 in such contexts, or do=
es it rely on an implicit conversion?  This was a deliberate point of discu=
ssion in the language design for C++11, and the conclusion is that when the=
 a language construct requires such a conversion, it is a =E2=80=98contextu=
al=E2=80=99 conversion that has access to explicit conversions.  That is de=
liberately intended, as it is idiomatic to be able to test smart pointers j=
ust like raw pointers, and that idiom must continue to be supported for raw=
 pointers for compatibility with inline C functions (even if we were prepar=
ed to break a large amount of existing C++ code).

This solves the problem of implicit conversion when passing arguments, retu=
rning values, or initializing variables, and avoids introducing an insidiou=
s support for =E2=80=98operator=3D=3D=E2=80=98 that happens with implicit c=
onversions.

This was deemed to be the sweet spot of convenience vs. accidental misuse, =
and was extended to integral types in general (e.g., for switch statements)=
 in C++14.

If we were to revoke contextual conversions, we would go a long way towards=
 what you are asking for, but I would expect significant objections from ma=
ny customers deliberately using the existing features as intended.

AlisdairM

Sent from my iPhone

> On Oct 5, 2018, at 9:48 PM, Johnny Shaw <johnnyshaw02@gmail.com> wrote:
>=20
> Recently I=E2=80=99ve noticed some interpretations of the following stand=
ards resulting in removing of compiler warnings around implicit conversions=
 to a =E2=80=98bool=E2=80=99 type:
>=20
> =20
>=20
> 1) C++14 =C2=A74.12/1 =E2=80=9CA zero value, null pointer value, or null =
member pointer value is converted to false; any other value is converted to=
 true. For direct-initialization (8.5), a prvalue of type std::nullptr_t ca=
n be converted to a prvalue of type bool; the resulting value is false.=E2=
=80=9D
> 2) C99 and C11 =C2=A76.3.1.2/1 =E2=80=9CWhen any scalar value is converte=
d to _Bool, the result is 0 if the value compares equal to 0; otherwise, th=
e result is 1.=E2=80=9D
>=20
> =20
>=20
> Specifically, the VS1017 compiler has removed the following warning compl=
etely:
>=20
> https://msdn.microsoft.com/en-us/library/b6801kcy.aspx
>=20
> =20
>=20
> Over correspondence with Microsoft I=E2=80=99ve noticed it my be due to d=
irect interpretation of standards. See:
>=20
> https://developercommunity.visualstudio.com/content/problem/346302/vs2017=
-158-c-fails-to-warn-when-forcing-int-to-boo.html
>=20
> https://developercommunity.visualstudio.com/content/problem/349342/visual=
-studio-2017-158-allows-implicit-conversion.html
>=20
> =20
>=20
> This is moving the bar backward a bit, resulting in unintended bugs being=
 overlooked that would have previously been caught by the compiler.
>=20
> =20
>=20
> While there is value in implicit conversion under some circumstances. Exp=
licit conversion clearly identifies the intent and eliminates mistakes. Enf=
orcing a standard that requires explicit conversion to bool, at very least =
for a return value, will eliminate possible coding errors. The following ar=
e some mundane examples and could be overlooked with given more complex cod=
e:
>=20
> =20
>=20
> bool TestFunc(int a)
> {
>     return a;=20
> }=20
>=20
> bool TestFuncNotOver100(int a)=20
> {=20
>     if (a > 100)=20
>     {=20
>         return a;
>     }=20
>     return true;=20
> }=20
>=20
> bool TestPointerForNull(void* pvX)=20
> {
>     if (nullptr !=3D pvX)=20
>     {
>         return false;=20
>     }=20
>     return pvX;=20
> }
>=20
>=20
> =20
>=20
> At very least requiring a check against a matching type by boolean operat=
ion, for example:
>=20
>=20
> bool TestFunc(int a)
> {
>     return (0 =3D=3D a);=20
> }
>=20
>=20
> =20
>=20
> Or for assignment:
>=20
> =20
>=20
> int a =3D 1;
> bool bValue =3D (0 =3D=3D a);
>=20
>=20
> =20
>=20
> Moreover, requiring an explicit cast:
>=20
> =20
>=20
> bool TestFunc(int a)
> {
>     return static_cast<bool>(a);=20
> }
>=20
>=20
> --=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=
 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/isoc=
pp.org/d/msgid/std-proposals/5df28d28-a2f4-47cd-9da7-49c91ed6d6f4%40isocpp.=
org.

--=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/223EEFC6-6D0B-40CA-B0F7-493F246ED08A%40me.com.

--Apple-Mail-C2861EA1-2964-47E6-978E-2A0234A1B5AC
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=
=3Dutf-8"></head><body dir=3D"auto">This is why explicit conversion operato=
rs were introduced in C++11, if they were already mentioned in this thread,=
 then sorry, I missed them.<div><br></div><div>Once we have the ability to =
mark a conversion as explicit, then we are left with the question of how th=
e language forms a conversion when one is needed, such as the predicate in =
an =E2=80=98if=E2=80=99. &nbsp;Is the language forming an explicit conversi=
on to =E2=80=98bool=E2=80=99 in such contexts, or does it rely on an implic=
it conversion? &nbsp;This was a deliberate point of discussion in the langu=
age design for C++11, and the conclusion is that when the a language constr=
uct requires such a conversion, it is a =E2=80=98contextual=E2=80=99 conver=
sion that has access to explicit conversions. &nbsp;That is deliberately in=
tended, as it is idiomatic to be able to test smart pointers just like raw =
pointers, and that idiom must continue to be supported for raw pointers for=
 compatibility with inline C functions (even if we were prepared to break a=
 large amount of existing C++ code).</div><div><br></div><div>This solves t=
he problem of implicit conversion when passing arguments, returning values,=
 or initializing variables, and avoids introducing an insidious support for=
 =E2=80=98operator=3D=3D=E2=80=98 that happens with implicit conversions.</=
div><div><br></div><div>This was deemed to be the sweet spot of convenience=
 vs. accidental misuse, and was extended to integral types in general (e.g.=
, for switch statements) in C++14.</div><div><br></div><div>If we were to r=
evoke contextual conversions, we would go a long way towards what you are a=
sking for, but I would expect significant objections from many customers de=
liberately using the existing features as intended.</div><div><br></div><di=
v>AlisdairM<br><br><div id=3D"AppleMailSignature" dir=3D"ltr">Sent from my =
iPhone</div><div dir=3D"ltr"><br>On Oct 5, 2018, at 9:48 PM, Johnny Shaw &l=
t;<a href=3D"mailto:johnnyshaw02@gmail.com">johnnyshaw02@gmail.com</a>&gt; =
wrote:<br><br></div><blockquote type=3D"cite"><div dir=3D"ltr"><div dir=3D"=
ltr"><p class=3D"MsoNormal">Recently I=E2=80=99ve noticed some
interpretations of the following standards resulting in removing of compile=
r
warnings around implicit conversions to a =E2=80=98bool=E2=80=99 type:<o:p>=
</o:p></p>

<p class=3D"MsoNormal">&nbsp;<o:p></o:p></p>

<p class=3D"MsoNormal"><sup><span style=3D"font-size: 7pt; font-family: Ari=
al, sans-serif; color: rgb(36, 39, 41); border-width: 1pt; border-style: no=
ne; border-color: windowtext; padding: 0in; background-image: initial; back=
ground-position: initial; background-size: initial; background-repeat: init=
ial; background-attachment: initial; background-origin: initial; background=
-clip: initial;">1)</span></sup><span style=3D"font-size: 9pt; font-family:=
 Arial, sans-serif; color: rgb(36, 39, 41); background-image: initial; back=
ground-position: initial; background-size: initial; background-repeat: init=
ial; background-attachment: initial; background-origin: initial; background=
-clip: initial;">&nbsp;C++14
=C2=A74.12/1 =E2=80=9CA zero value, null pointer value, or null member poin=
ter value is converted
to&nbsp;</span><code><span style=3D"font-size: 10pt; font-family: Consolas;=
 color: rgb(36, 39, 41); border-width: 1pt; border-style: none; border-colo=
r: windowtext; padding: 0in; background: rgb(239, 240, 241);">false</span><=
/code><span style=3D"font-size: 9pt; font-family: Arial, sans-serif; color:=
 rgb(36, 39, 41); background-image: initial; background-position: initial; =
background-size: initial; background-repeat: initial; background-attachment=
: initial; background-origin: initial; background-clip: initial;">; any oth=
er
value is converted to&nbsp;</span><code><span style=3D"font-size: 10pt; fon=
t-family: Consolas; color: rgb(36, 39, 41); border-width: 1pt; border-style=
: none; border-color: windowtext; padding: 0in; background: rgb(239, 240, 2=
41);">true</span></code><span style=3D"font-size: 9pt; font-family: Arial, =
sans-serif; color: rgb(36, 39, 41); background-image: initial; background-p=
osition: initial; background-size: initial; background-repeat: initial; bac=
kground-attachment: initial; background-origin: initial; background-clip: i=
nitial;">. For direct-initialization (8.5), a prvalue of type&nbsp;</span><=
code><span style=3D"font-size: 10pt; font-family: Consolas; color: rgb(36, =
39, 41); border-width: 1pt; border-style: none; border-color: windowtext; p=
adding: 0in; background: rgb(239, 240, 241);">std::nullptr_t</span></code><=
span style=3D"font-size: 9pt; font-family: Arial, sans-serif; color: rgb(36=
, 39, 41); background-image: initial; background-position: initial; backgro=
und-size: initial; background-repeat: initial; background-attachment: initi=
al; background-origin: initial; background-clip: initial;">&nbsp;can be con=
verted to a prvalue of type&nbsp;</span><code><span style=3D"font-size: 10p=
t; font-family: Consolas; color: rgb(36, 39, 41); border-width: 1pt; border=
-style: none; border-color: windowtext; padding: 0in; background: rgb(239, =
240, 241);">bool</span></code><span style=3D"font-size: 9pt; font-family: A=
rial, sans-serif; color: rgb(36, 39, 41); background-image: initial; backgr=
ound-position: initial; background-size: initial; background-repeat: initia=
l; background-attachment: initial; background-origin: initial; background-c=
lip: initial;">; the resulting value is&nbsp;</span><code><span style=3D"fo=
nt-size: 10pt; font-family: Consolas; color: rgb(36, 39, 41); border-width:=
 1pt; border-style: none; border-color: windowtext; padding: 0in; backgroun=
d: rgb(239, 240, 241);">false</span></code><span style=3D"font-size: 9pt; f=
ont-family: Arial, sans-serif; color: rgb(36, 39, 41); background-image: in=
itial; background-position: initial; background-size: initial; background-r=
epeat: initial; background-attachment: initial; background-origin: initial;=
 background-clip: initial;">.=E2=80=9D</span><span style=3D"font-size:9.0pt=
;font-family:&quot;Arial&quot;,sans-serif;
color:#242729"><br>
</span><sup><span style=3D"font-size: 7pt; font-family: Arial, sans-serif; =
color: rgb(36, 39, 41); border-width: 1pt; border-style: none; border-color=
: windowtext; padding: 0in; background-image: initial; background-position:=
 initial; background-size: initial; background-repeat: initial; background-=
attachment: initial; background-origin: initial; background-clip: initial;"=
>2)</span></sup><span style=3D"font-size: 9pt; font-family: Arial, sans-ser=
if; color: rgb(36, 39, 41); background-image: initial; background-position:=
 initial; background-size: initial; background-repeat: initial; background-=
attachment: initial; background-origin: initial; background-clip: initial;"=
>&nbsp;C99 and
C11 =C2=A76.3.1.2/1 =E2=80=9CWhen any scalar value is converted to&nbsp;</s=
pan><code><span style=3D"font-size: 10pt; font-family: Consolas; color: rgb=
(36, 39, 41); border-width: 1pt; border-style: none; border-color: windowte=
xt; padding: 0in; background: rgb(239, 240, 241);">_Bool</span></code><span=
 style=3D"font-size: 9pt; font-family: Arial, sans-serif; color: rgb(36, 39=
, 41); background-image: initial; background-position: initial; background-=
size: initial; background-repeat: initial; background-attachment: initial; =
background-origin: initial; background-clip: initial;">, the result is 0 if=
 the value compares equal to 0; otherwise, the
result is 1.=E2=80=9D</span><o:p></o:p></p>

<p class=3D"MsoNormal">&nbsp;<o:p></o:p></p>

<p class=3D"MsoNormal">Specifically, the VS1017 compiler has
removed the following warning completely:<o:p></o:p></p>

<p class=3D"MsoNormal"><a href=3D"https://msdn.microsoft.com/en-us/library/=
b6801kcy.aspx">https://msdn.microsoft.com/en-us/library/b6801kcy.aspx</a><o=
:p></o:p></p>

<p class=3D"MsoNormal">&nbsp;<o:p></o:p></p>

<p class=3D"MsoNormal">Over correspondence with Microsoft I=E2=80=99ve
noticed it my be due to
direct interpretation of standards. See:<o:p></o:p></p>

<p class=3D"MsoNormal"><a href=3D"https://developercommunity.visualstudio.c=
om/content/problem/346302/vs2017-158-c-fails-to-warn-when-forcing-int-to-bo=
o.html">https://developercommunity.visualstudio.com/content/problem/346302/=
vs2017-158-c-fails-to-warn-when-forcing-int-to-boo.html</a><o:p></o:p></p>

<p class=3D"MsoNormal"><a href=3D"https://developercommunity.visualstudio.c=
om/content/problem/349342/visual-studio-2017-158-allows-implicit-conversion=
..html">https://developercommunity.visualstudio.com/content/problem/349342/v=
isual-studio-2017-158-allows-implicit-conversion.html</a><o:p></o:p></p>

<p class=3D"MsoNormal">&nbsp;<o:p></o:p></p>

<p class=3D"MsoNormal">This is moving the bar backward a bit,
resulting in unintended bugs being overlooked that would have previously be=
en
caught by the compiler.<o:p></o:p></p>

<p class=3D"MsoNormal">&nbsp;<o:p></o:p></p>

<p class=3D"MsoNormal">While there is value in implicit
conversion under some circumstances. Explicit conversion clearly identifies=
 the
intent and eliminates mistakes. Enforcing a standard that requires explicit
conversion to bool, at very least for a return value, will eliminate possib=
le
coding errors. The following are some mundane examples and could be overloo=
ked
with given more complex code:<o:p></o:p></p>

<p class=3D"MsoNormal">&nbsp;<o:p></o:p></p>

<div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); b=
order-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; ov=
erflow-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subpret=
typrint"><span style=3D"color: #008;" class=3D"styled-by-prettify">bool</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #606;" class=3D"styled-by-prettify">TestFunc</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">int</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> a</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"><br></span><font color=3D"#000000"><span style=3D"color: #000;" class=3D"=
styled-by-prettify">&nbsp; &nbsp; </span></font><span style=3D"color: #008;=
" class=3D"styled-by-prettify">return</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> a</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> <br></span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <br=
><br></span><span style=3D"color: #008;" class=3D"styled-by-prettify">bool<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><sp=
an style=3D"color: #606;" class=3D"styled-by-prettify">TestFuncNotOver100</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><spa=
n style=3D"color: #008;" class=3D"styled-by-prettify">int</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> a</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> <br></span><span style=3D"color: #660;" clas=
s=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> <br>&nbsp; &nbsp; </span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">if</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pr=
ettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">a=
 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">&gt;</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span s=
tyle=3D"color: #066;" class=3D"styled-by-prettify">100</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> <br>&nbsp; &nbsp; </span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> <br></span><font color=3D"#000000"><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify">&nbsp; &nbsp; &nbsp; =
&nbsp; </span></font><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">return</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 a</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp;=
 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> <br>&nbsp; &nbsp;=
 </span><span style=3D"color: #008;" class=3D"styled-by-prettify">return</s=
pan><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span=
 style=3D"color: #008;" class=3D"styled-by-prettify">true</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> <br></span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> <br><br></span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">bool</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by-p=
rettify">TestPointerForNull</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">(</span><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">void</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">*</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> pvX</s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"> <br></span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"><br>&nbsp; &nbsp; </span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">if</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">(</span><span style=3D"color: #008;" class=3D=
"styled-by-prettify">nullptr</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">!=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> pvX</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <br>&nbsp; =
&nbsp; </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>&nbsp; &=
nbsp; &nbsp; &nbsp; </span><span style=3D"color: #008;" class=3D"styled-by-=
prettify">return</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">fal=
se</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> <br>&nbsp; &nbsp=
; </span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> <br>&nbsp; &nbsp=
; </span><span style=3D"color: #008;" class=3D"styled-by-prettify">return</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"> pvX</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span styl=
e=3D"color: #000;" class=3D"styled-by-prettify"> <br></span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">}</span></div></code></div><p cl=
ass=3D"MsoNormal"><br><o:p></o:p></p>

<p class=3D"MsoNormal">&nbsp;<o:p></o:p></p>

<p class=3D"MsoNormal">At very least requiring a check against a
matching type by boolean operation, for example:<o:p></o:p></p>

<br>

<div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); b=
order-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; ov=
erflow-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subpret=
typrint"><span style=3D"color: #008;" class=3D"styled-by-prettify">bool</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #606;" class=3D"styled-by-prettify">TestFunc</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">int</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> a</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"><br>&nbsp; &nbsp; </span><span style=3D"color: #008;" class=3D"styled-by-=
prettify">return</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</=
span><span style=3D"color: #066;" class=3D"styled-by-prettify">0</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">=3D=3D</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> a</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> <br></span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">}</span></div></code></div><p class=3D"MsoNormal"><=
br><o:p></o:p></p>

<p class=3D"MsoNormal">&nbsp;<o:p></o:p></p>

<p class=3D"MsoNormal">Or for assignment:<o:p></o:p></p>

<p class=3D"MsoNormal">&nbsp;<o:p></o:p></p>

<div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); b=
order-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; ov=
erflow-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subpret=
typrint"><span style=3D"color: #008;" class=3D"styled-by-prettify">int</spa=
n><span style=3D"color: #000;" class=3D"styled-by-prettify"> a </span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #066;" class=3D"styled-by-prettify">1</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">;</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br></span><span style=3D"color: #008;" class=3D"styled=
-by-prettify">bool</span><span style=3D"color: #000;" class=3D"styled-by-pr=
ettify"> bValue </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><s=
pan style=3D"color: #066;" class=3D"styled-by-prettify">0</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">=3D=3D</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> a</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">);</span></div></code></div><p class=3D"MsoNormal=
"><br><o:p></o:p></p>

<p class=3D"MsoNormal">&nbsp;<o:p></o:p></p>

<p class=3D"MsoNormal">Moreover, requiring an explicit cast:<o:p></o:p></p>

<p class=3D"MsoNormal">&nbsp;<o:p></o:p></p>

<div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250); b=
order-color: rgb(187, 187, 187); border-style: solid; border-width: 1px; ov=
erflow-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subpret=
typrint"><span style=3D"color: #008;" class=3D"styled-by-prettify">bool</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #606;" class=3D"styled-by-prettify">TestFunc</span><span st=
yle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">int</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"> a</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"sty=
led-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"><br>&nbsp; &nbsp; </span><span style=3D"color: #008;" class=3D"styled-by-=
prettify">return</span><span style=3D"color: #000;" class=3D"styled-by-pret=
tify"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">sta=
tic_cast</span><span style=3D"color: #080;" class=3D"styled-by-prettify">&l=
t;bool&gt;</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">a</span><=
span style=3D"color: #660;" class=3D"styled-by-prettify">);</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> <br></span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">}</span></div></code></div><p c=
lass=3D"MsoNormal"><br><o:p></o:p></p></div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups "=
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/5df28d28-a2f4-47cd-9da7-49c91ed6d6f4%=
40isocpp.org?utm_medium=3Demail&amp;utm_source=3Dfooter">https://groups.goo=
gle.com/a/isocpp.org/d/msgid/std-proposals/5df28d28-a2f4-47cd-9da7-49c91ed6=
d6f4%40isocpp.org</a>.<br>
</div></blockquote></div></body></html>

<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/223EEFC6-6D0B-40CA-B0F7-493F246ED08A%=
40me.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/223EEFC6-6D0B-40CA-B0F7-493F246ED08A%40m=
e.com</a>.<br />

--Apple-Mail-C2861EA1-2964-47E6-978E-2A0234A1B5AC--

.


Author: Hyman Rosen <hyman.rosen@gmail.com>
Date: Mon, 8 Oct 2018 13:59:04 -0400
Raw View
--00000000000021c1150577bb61bf
Content-Type: text/plain; charset="UTF-8"

On Mon, Oct 8, 2018 at 1:40 PM Andrew Sandoval <sandoval@netwaysglobal.com>
wrote:

> I can argue that the current automatic / implicit conversion violates type
> safety.
>

Automatic type conversion is everywhere in C and C++.
That ship sailed decades ago.

  The only argument so far that I've seen for implicit conversion of bool
> is because there is some existing code that would break if it changed.
>

You have missed the argument that conversion from non-zero to true
and zero to false is nearly always what people want.

--
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/CAHSYqdah32J75_QvLYRGGr1qt6LBDOGnRGOqzBG9rEuhNC0K%3DQ%40mail.gmail.com.

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

<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Mon, Oct 8,=
 2018 at 1:40 PM Andrew Sandoval &lt;<a href=3D"mailto:sandoval@netwaysglob=
al.com">sandoval@netwaysglobal.com</a>&gt; wrote:</div><blockquote class=3D=
"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding=
-left:1ex"><div dir=3D"ltr"><div class=3D"m_6821213430516039212gmail_signat=
ure" data-smartmail=3D"gmail_signature">I can argue that the current automa=
tic / implicit conversion violates type safety.</div></div></blockquote><di=
v><br>Automatic type conversion is everywhere in C and C++.<br>That ship sa=
iled decades ago.<br><br></div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"l=
tr"><div class=3D"m_6821213430516039212gmail_signature" data-smartmail=3D"g=
mail_signature">=C2=A0 The only argument so far that I&#39;ve seen for impl=
icit conversion of bool is because there is some existing code that would b=
reak if it changed.</div></div></blockquote><div><br>You have missed the ar=
gument that conversion from non-zero to true<br>and zero to false is nearly=
 always what people want.</div></div></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/CAHSYqdah32J75_QvLYRGGr1qt6LBDOGnRGOq=
zBG9rEuhNC0K%3DQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdah32J75_=
QvLYRGGr1qt6LBDOGnRGOqzBG9rEuhNC0K%3DQ%40mail.gmail.com</a>.<br />

--00000000000021c1150577bb61bf--

.


Author: Thiago Macieira <thiago@macieira.org>
Date: Mon, 08 Oct 2018 12:43:40 -0700
Raw View
On Monday, 8 October 2018 10:43:40 PDT Hyman Rosen wrote:
> On Sun, Oct 7, 2018 at 1:05 PM Ville Voutilainen <
>
> ville.voutilainen@gmail.com> wrote:
> > On Sun, 7 Oct 2018 at 19:38, Andrew Sandoval <sandoval@netwaysglobal.com>
> >
> > wrote:
> > > How does a compiler warning break any existing code?
> >
> > Very easily, this happens on every major compiler release. A compiler
> > adds a new warning, enables it under warning flags
> > that users already use, and -Werror does the rest.
>
> If people build using -Werror then they are not programming in C++, but in
> some
> subset language arbitrarily determined by their implementor.  Why should a
> group
> devoted to Standard C++ care about people who program in a different
> language?

By the same token, warnings need not be discussed in this mailing list because
they are not part of the C++ standard. They are QoI at best.

Anyway, I recommend Andrew and other interested parties suggest the creation
of a Study Group to propose and maintain a Standing Document that focuses on
warnings compiler implementers ought to have, those that have a proven track
record of improving code quality and those new ones that have the potential to
prevent new bugs. This SG may also come up with a list of constructs that
should be more than just warnings and should be completely rejected, like the
case of deleting incomplete types we discussed last month.

And if I may make a suggestion: make sure every warning comes with one or more
solutions to suppress the warning that don't include compiler switches or
#pragmas. Examples:

1) && precedence over ||
 if (a && b || c)
suggested:
 if ((a && b) || c)

2) memcpy a non-trivially-copyable type
 memcpy(&dst, &src, sizeof(*dst));
suggested:
 memcpy(static_cast<void *>(&dst), static_cast(&src), sizeof(*dst));

3) cast to bool
 return ptr;
suggested:
 return bool(ptr);

4) signed integer overflow
 // alloc's value is known by propagation to be size + 1
 if (size + count > alloc)
suggested:
 ????

etc.

--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center



--
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/2347972.SxI5vlWqa4%40tjmaciei-mobl1.

.


Author: Johnny Shaw <johnnyshaw02@gmail.com>
Date: Mon, 8 Oct 2018 13:05:06 -0700 (PDT)
Raw View
------=_Part_1736_989557358.1539029106582
Content-Type: multipart/alternative;
 boundary="----=_Part_1737_823428636.1539029106584"

------=_Part_1737_823428636.1539029106584
Content-Type: text/plain; charset="UTF-8"

If I may diverge the conversation slightly. Say I wanted to enforce more
type safety myself using constructs available in the language. How would I
go about doing that? I don't think it's possible, maybe I'm just missing
something:

#include <iostream>

enum class Boolean : char
{
    False,
    True
};

class boolean_t
{
private:
    Boolean m_bVal{ Boolean::False };

public:
    boolean_t() = default;

    boolean_t(Boolean bVal) : m_bVal(bVal)
    {
    }


    boolean_t(const boolean_t& bCopy) : m_bVal(bCopy.m_bVal)
    {
    }

    boolean_t(bool) = delete; // explicitly deleted construction from 'bool'

    operator bool()
    {
        if (Boolean::False == m_bVal)
        {
            return false;
        }
        return true;
    }


    operator Boolean()
    {
        return m_bVal;
    }


    friend boolean_t operator==(int lVal, int rVal) // not possible, must
have at least one formal parameter of class type
    {
        if (lVal == rVal)
        {
            return Boolean::True;
        }
        return Boolean::False;
     }
};


boolean_t Test(int x)
{
    return (0 == x); // no constructor for 'boolean_t' by 'bool', no
matching operator== that returns 'boolean_t'
}


int main()
{
    std::cout << (true == Test(100) ? "true" : "false");
    return 0;
}

In the Test function the value is going to be implicitly case too a bool.
However, I've explicitly deleted the constructor for a 'boolean_t' from a
'bool'. Implementing one results in functional code, but does not enforce a
contact that a developer make a comparison against a matching type. For
example:

boolean_t(bool bVal)  : m_bVal(true == bVal ? Boolean::True : Boolean::False
)
{
}

boolean_t Test(int x)
{
    return (0 == x); // allows this
}

boolean_t Test(int x)
{
    return x; // but also allows this, defeating the purpose
}

If I could do something like this:

friend boolean_t operator==(int lVal, int rVal)
{
    if (lVal == rVal)
    {
        return Boolean::True;
    }
    return Boolean::False;
}

That would give me a means to enforce type safety around bool usage. Maybe
there is mechanism I'm not keen to.

--
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/633356f3-a4f8-4f05-bf78-aa7cf3353dc4%40isocpp.org.

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

<div dir=3D"ltr">If I may diverge the conversation slightly. Say I wanted t=
o enforce more type safety myself using constructs available in the languag=
e. How would I go about doing that? I don&#39;t think it&#39;s possible, ma=
ybe I&#39;m just missing something:<div><br></div><div><div class=3D"pretty=
print" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(187=
, 187, 187); border-style: solid; border-width: 1px; overflow-wrap: break-w=
ord;"><code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=
=3D"color: #800;" class=3D"styled-by-prettify">#include</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #080;" class=3D"styled-by-prettify">&lt;iostream&gt;</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br><br></span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">enum</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;" cl=
ass=3D"styled-by-prettify">class</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"style=
d-by-prettify">Boolean</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">:</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #008;" class=3D"styled-by-prettify">char</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> <br></span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span styl=
e=3D"color: #008;" class=3D"styled-by-prettify">False</span><span style=3D"=
color: #660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #0=
00;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">True</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">};</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br><br></span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">class</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"> boolean_t<br></span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"><br></span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">private</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">:</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
>=C2=A0 =C2=A0 </span><span style=3D"color: #606;" class=3D"styled-by-prett=
ify">Boolean</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> m_bVal</span><span style=3D"color: #660;" class=3D"styled-by-prettify">{=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><s=
pan style=3D"color: #606;" class=3D"styled-by-prettify">Boolean</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">False</span><span style=3D"c=
olor: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #66=
0;" class=3D"styled-by-prettify">};</span><span style=3D"color: #000;" clas=
s=3D"styled-by-prettify"><br><br></span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">public</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">:</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br>=C2=A0 =C2=A0 boolean_t</span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">()</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">defau=
lt</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br>=C2=A0 =
=C2=A0 boolean_t</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">(</span><span style=3D"color: #606;" class=3D"styled-by-prettify">Boo=
lean</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> bVal<=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"> m_bVal</span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify">bVal</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"st=
yled-by-prettify">}</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"><br><br><br>=C2=A0 =C2=A0 boolean_t</span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;" clas=
s=3D"styled-by-prettify">const</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> boolean_t</span><span style=3D"color: #660;" class=3D"=
styled-by-prettify">&amp;</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> bCopy</span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">:</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> m_bVal</span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify">bCopy</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">.</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify">m_bVal</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" c=
lass=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"s=
tyled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br><br>=C2=A0 =C2=A0 boolean_t</span><span style=3D"colo=
r: #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;"=
 class=3D"styled-by-prettify">bool</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> =
</span><span style=3D"color: #008;" class=3D"styled-by-prettify">delete</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"=
color: #800;" class=3D"styled-by-prettify">// explicitly deleted constructi=
on from &#39;bool&#39;</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"><br><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">operator</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">bool</span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">()</span><span style=3D"color: #000;" class=3D"styled-by-prettify"=
><br>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-p=
rettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
<br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">if</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">(</span><span style=3D"color: #606;" class=3D"styled-by-prettify">Bo=
olean</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</s=
pan><span style=3D"color: #008;" class=3D"styled-by-prettify">False</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">=3D=3D</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> m_bVal</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><spa=
n style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-pr=
ettify">return</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">false=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><s=
pan style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">return</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> </span><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">true</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0=
 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">}<=
/span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br><br=
>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">operator</span><span style=3D"color: #000;" class=3D"styled-by-prettif=
y"> </span><span style=3D"color: #606;" class=3D"styled-by-prettify">Boolea=
n</span><span style=3D"color: #660;" class=3D"styled-by-prettify">()</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0=
 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">return</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 m_bVal</span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =
=C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</=
span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><br><br>=
=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-pretti=
fy">friend</span><span style=3D"color: #000;" class=3D"styled-by-prettify">=
 boolean_t </span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>operator</span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
=3D=3D(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">int=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> lVal</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">,</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #008;" class=3D"styled-by-prettify">int</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"> rVal</span><span style=3D"color: #660;"=
 class=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D=
"styled-by-prettify"> </span><span style=3D"color: #800;" class=3D"styled-b=
y-prettify">// not possible, must have at least one formal parameter of cla=
ss type</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br=
>=C2=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">if</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>(</span><span style=3D"color: #000;" class=3D"styled-by-prettify">lVal </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D=3D</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> rVal</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=A0 =C2=A0=
 </span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"st=
yled-by-prettify">return</span><span style=3D"color: #000;" class=3D"styled=
-by-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by-prett=
ify">Boolean</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">::</span><span style=3D"color: #008;" class=3D"styled-by-prettify">True</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 </span><span style=3D"color: #660;" class=3D"styled-by-prettify"=
>}</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">return</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> </span><span style=3D"color: #606;" class=3D"styled-by-prettify=
">Boolean</span><span style=3D"color: #660;" class=3D"styled-by-prettify">:=
:</span><span style=3D"color: #008;" class=3D"styled-by-prettify">False</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">;</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=
=A0</span><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">};</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"><br><br><br>boolean_t </span=
><span style=3D"color: #606;" class=3D"styled-by-prettify">Test</span><span=
 style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D=
"color: #008;" class=3D"styled-by-prettify">int</span><span style=3D"color:=
 #000;" class=3D"styled-by-prettify"> x</span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">)</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br></span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">{</span><span style=3D"color: #000;" class=3D"styled-by-prett=
ify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-=
by-prettify">return</span><span style=3D"color: #000;" class=3D"styled-by-p=
rettify"> </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=
(</span><span style=3D"color: #066;" class=3D"styled-by-prettify">0</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span styl=
e=3D"color: #660;" class=3D"styled-by-prettify">=3D=3D</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> x</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">);</span><span style=3D"color: #000;" c=
lass=3D"styled-by-prettify"> </span><span style=3D"color: #800;" class=3D"s=
tyled-by-prettify">// no constructor for &#39;boolean_t&#39; by &#39;bool&#=
39;, no matching</span><span style=3D"color: #800;" class=3D"styled-by-pret=
tify"> operator=3D=3D that returns &#39;boolean_t&#39;</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">}</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"><br><br><br></span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">int</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> main</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">()</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-prett=
ify">{</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br>=
=C2=A0 =C2=A0 std</span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">::</span><span style=3D"color: #000;" class=3D"styled-by-prettify">c=
out </span><span style=3D"color: #660;" class=3D"styled-by-prettify">&lt;&l=
t;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">(</span><span sty=
le=3D"color: #008;" class=3D"styled-by-prettify">true</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #6=
60;" class=3D"styled-by-prettify">=3D=3D</span><span style=3D"color: #000;"=
 class=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D=
"styled-by-prettify">Test</span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">(</span><span style=3D"color: #066;" class=3D"styled-by-pret=
tify">100</span><span style=3D"color: #660;" class=3D"styled-by-prettify">)=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><s=
pan style=3D"color: #660;" class=3D"styled-by-prettify">?</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #080;" class=3D"styled-by-prettify">&quot;true&quot;</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #=
660;" class=3D"styled-by-prettify">:</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> </span><span style=3D"color: #080;" class=3D"sty=
led-by-prettify">&quot;false&quot;</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">);</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">return</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by=
-prettify">0</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span></div=
></code></div><div><br></div></div><div>In the Test function the value is g=
oing to be implicitly case too a bool. However, I&#39;ve explicitly deleted=
 the constructor for a &#39;boolean_t&#39; from a &#39;bool&#39;. Implement=
ing one results in functional code, but does not enforce a contact that a d=
eveloper make a comparison against a matching type. For example:</div><div>=
<br></div><div><div class=3D"prettyprint" style=3D"background-color: rgb(25=
0, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; border=
-width: 1px; overflow-wrap: break-word;"><code class=3D"prettyprint"><div c=
lass=3D"subprettyprint"><span style=3D"color: #000;" class=3D"styled-by-pre=
ttify">boolean_t</span><span style=3D"color: #660;" class=3D"styled-by-pret=
tify">(</span><span style=3D"color: #008;" class=3D"styled-by-prettify">boo=
l</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> bVal</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"> =C2=A0</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">:</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> m_bVal</span><span style=3D"color:=
 #660;" class=3D"styled-by-prettify">(</span><span style=3D"color: #008;" c=
lass=3D"styled-by-prettify">true</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">=3D=3D</span><span style=3D"color: #000;" class=3D"styled-by=
-prettify"> bVal </span><span style=3D"color: #660;" class=3D"styled-by-pre=
ttify">?</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> <=
/span><span style=3D"color: #606;" class=3D"styled-by-prettify">Boolean</sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span=
 style=3D"color: #008;" class=3D"styled-by-prettify">True</span><span style=
=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color=
: #660;" class=3D"styled-by-prettify">:</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"> </span><span style=3D"color: #606;" class=3D"=
styled-by-prettify">Boolean</span><span style=3D"color: #660;" class=3D"sty=
led-by-prettify">::</span><span style=3D"color: #008;" class=3D"styled-by-p=
rettify">False</span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br><=
/span><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><sp=
an style=3D"color: #000;" class=3D"styled-by-prettify"><br></span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">}</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"><br><br>boolean_t </span><span styl=
e=3D"color: #606;" class=3D"styled-by-prettify">Test</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">(</span><font color=3D"#000088"><=
span style=3D"color: #008;" class=3D"styled-by-prettify">int</span><span st=
yle=3D"color: #000;" class=3D"styled-by-prettify"> x</span><span style=3D"c=
olor: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #00=
0;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" cla=
ss=3D"styled-by-prettify">return</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"style=
d-by-prettify">(</span><span style=3D"color: #066;" class=3D"styled-by-pret=
tify">0</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D=3D</span=
><span style=3D"color: #000;" class=3D"styled-by-prettify"> x</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #8=
00;" class=3D"styled-by-prettify">// allows this</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #660=
;" class=3D"styled-by-prettify">}</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"><br><br>boolean_t </span><span style=3D"color: #606=
;" class=3D"styled-by-prettify">Test</span><span style=3D"color: #660;" cla=
ss=3D"styled-by-prettify">(</span><span style=3D"color: #008;" class=3D"sty=
led-by-prettify">int</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> x</span><span style=3D"color: #660;" class=3D"styled-by-prettify=
">)</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </sp=
an><span style=3D"color: #008;" class=3D"styled-by-prettify">return</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify"> x</span><span sty=
le=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #800;=
" class=3D"styled-by-prettify">// but also allows this, defeating the purpo=
se</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></sp=
an><span style=3D"color: #660;" class=3D"styled-by-prettify">}</span><span =
style=3D"color: #000;" class=3D"styled-by-prettify"><br></span></font></div=
></code></div><br>If I could do something like this:</div><div><br></div><d=
iv><div class=3D"prettyprint" style=3D"background-color: rgb(250, 250, 250)=
; border-color: rgb(187, 187, 187); border-style: solid; border-width: 1px;=
 overflow-wrap: break-word;"><code class=3D"prettyprint"><div class=3D"subp=
rettyprint"><font color=3D"#660066"><span style=3D"color: #008;" class=3D"s=
tyled-by-prettify">friend</span><span style=3D"color: #000;" class=3D"style=
d-by-prettify"> boolean_t </span><span style=3D"color: #008;" class=3D"styl=
ed-by-prettify">operator</span><span style=3D"color: #660;" class=3D"styled=
-by-prettify">=3D=3D(</span><span style=3D"color: #008;" class=3D"styled-by=
-prettify">int</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> lVal</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><s=
pan style=3D"color: #008;" class=3D"styled-by-prettify">int</span><span sty=
le=3D"color: #000;" class=3D"styled-by-prettify"> rVal</span><span style=3D=
"color: #660;" class=3D"styled-by-prettify">)</span><span style=3D"color: #=
000;" class=3D"styled-by-prettify"><br></span><span style=3D"color: #660;" =
class=3D"styled-by-prettify">{</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=3D"color: #008;" c=
lass=3D"styled-by-prettify">if</span><span style=3D"color: #000;" class=3D"=
styled-by-prettify"> </span><span style=3D"color: #660;" class=3D"styled-by=
-prettify">(</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
">lVal </span><span style=3D"color: #660;" class=3D"styled-by-prettify">=3D=
=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> rVal</=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">)</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </s=
pan><span style=3D"color: #660;" class=3D"styled-by-prettify">{</span><span=
 style=3D"color: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 =C2=
=A0 =C2=A0 </span><span style=3D"color: #008;" class=3D"styled-by-prettify"=
>return</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #606;" class=3D"styled-by-prettify">Boolean</spa=
n><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><span =
style=3D"color: #008;" class=3D"styled-by-prettify">True</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">}</span><span style=3D"color=
: #000;" class=3D"styled-by-prettify"><br>=C2=A0 =C2=A0 </span><span style=
=3D"color: #008;" class=3D"styled-by-prettify">return</span><span style=3D"=
color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #6=
06;" class=3D"styled-by-prettify">Boolean</span><span style=3D"color: #660;=
" class=3D"styled-by-prettify">::</span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">False</span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">;</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"><br></span><span style=3D"color: #660;" class=3D"styled-by-pretti=
fy">}</span></font></div></code></div><div><br></div>That would give me a m=
eans to enforce type safety around bool usage. Maybe there is mechanism I&#=
39;m not keen to.<br><br></div></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/633356f3-a4f8-4f05-bf78-aa7cf3353dc4%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/633356f3-a4f8-4f05-bf78-aa7cf3353dc4=
%40isocpp.org</a>.<br />

------=_Part_1737_823428636.1539029106584--

------=_Part_1736_989557358.1539029106582--

.


Author: Hyman Rosen <hyman.rosen@gmail.com>
Date: Mon, 8 Oct 2018 16:06:31 -0400
Raw View
--000000000000f271750577bd281c
Content-Type: text/plain; charset="UTF-8"

On Mon, Oct 8, 2018 at 3:43 PM Thiago Macieira <thiago@macieira.org> wrote:

> By the same token, warnings need not be discussed in this mailing list
> because
> they are not part of the C++ standard. They are QoI at best.
>

That's not true.  I'm looking at N4741, and it mentions warnings in a
number of places:
[dcl.attr.fallthrough], [dcl.attr.unused], [dcl.attr.nodiscard],
[dcl.attr.noreturn]
They're all in notes and examples, but those are still part of the
standard, and they say
things like "implementations should issue a warning" and "warning ...
discouraged".

--
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/CAHSYqdZcqvC4Len7ewSGr1cxVxaiknnU-mezQSYPmwGz4GsZiA%40mail.gmail.com.

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

<div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div di=
r=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Mon, Oct 8, 2018 a=
t 3:43 PM Thiago Macieira &lt;<a href=3D"mailto:thiago@macieira.org">thiago=
@macieira.org</a>&gt; wrote:</div><blockquote class=3D"gmail_quote" style=
=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding=
-left:1ex">
By the same token, warnings need not be discussed in this mailing list beca=
use <br>
they are not part of the C++ standard. They are QoI at best.<br></blockquot=
e><div><br>That&#39;s not true.=C2=A0 I&#39;m looking at N4741, and it ment=
ions warnings in a number of places:<br>[dcl.attr.fallthrough],=C2=A0[dcl.a=
ttr.unused],=C2=A0[dcl.attr.nodiscard],=C2=A0[dcl.attr.noreturn]<br>They&#3=
9;re all in notes and examples, but those are still part of the standard, a=
nd they say<br>things like &quot;implementations should issue a warning&quo=
t; and &quot;warning ... discouraged&quot;.</div></div></div></div></div></=
div></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/CAHSYqdZcqvC4Len7ewSGr1cxVxaiknnU-mez=
QSYPmwGz4GsZiA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdZcqvC4Len7=
ewSGr1cxVxaiknnU-mezQSYPmwGz4GsZiA%40mail.gmail.com</a>.<br />

--000000000000f271750577bd281c--

.


Author: "'Alisdair Meredith' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Mon, 08 Oct 2018 16:09:02 -0400
Raw View
--Apple-Mail-7FEE2F5F-86B0-40AB-BBDB-2B1B50AC458E
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

See my previous post on =E2=80=98explicit operator bool=E2=80=99, that woul=
d be useful for your implementation here, specifically avoiding the acciden=
tal operator=3D=3D.

AlisdairM

Sent from my iPhone

> On Oct 8, 2018, at 4:06 PM, Hyman Rosen <hyman.rosen@gmail.com> wrote:
>=20
>> On Mon, Oct 8, 2018 at 3:43 PM Thiago Macieira <thiago@macieira.org> wro=
te:
>> By the same token, warnings need not be discussed in this mailing list b=
ecause=20
>> they are not part of the C++ standard. They are QoI at best.
>=20
> That's not true.  I'm looking at N4741, and it mentions warnings in a num=
ber of places:
> [dcl.attr.fallthrough], [dcl.attr.unused], [dcl.attr.nodiscard], [dcl.att=
r.noreturn]
> They're all in notes and examples, but those are still part of the standa=
rd, and they say
> things like "implementations should issue a warning" and "warning ... dis=
couraged".
> --=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=
 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/isoc=
pp.org/d/msgid/std-proposals/CAHSYqdZcqvC4Len7ewSGr1cxVxaiknnU-mezQSYPmwGz4=
GsZiA%40mail.gmail.com.

--=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/E2DB90EB-4D96-49E6-8AD6-D235ADE418D1%40me.com.

--Apple-Mail-7FEE2F5F-86B0-40AB-BBDB-2B1B50AC458E
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=
=3Dutf-8"></head><body dir=3D"auto">See my previous post on =E2=80=98explic=
it operator bool=E2=80=99, that would be useful for your implementation her=
e, specifically avoiding the accidental operator=3D=3D.<div><br></div><div>=
AlisdairM<br><br><div id=3D"AppleMailSignature" dir=3D"ltr">Sent from my iP=
hone</div><div dir=3D"ltr"><br>On Oct 8, 2018, at 4:06 PM, Hyman Rosen &lt;=
<a href=3D"mailto:hyman.rosen@gmail.com">hyman.rosen@gmail.com</a>&gt; wrot=
e:<br><br></div><blockquote type=3D"cite"><div dir=3D"ltr"><div dir=3D"ltr"=
><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div c=
lass=3D"gmail_quote"><div dir=3D"ltr">On Mon, Oct 8, 2018 at 3:43 PM Thiago=
 Macieira &lt;<a href=3D"mailto:thiago@macieira.org">thiago@macieira.org</a=
>&gt; wrote:</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px=
 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
By the same token, warnings need not be discussed in this mailing list beca=
use <br>
they are not part of the C++ standard. They are QoI at best.<br></blockquot=
e><div><br>That's not true.&nbsp; I'm looking at N4741, and it mentions war=
nings in a number of places:<br>[dcl.attr.fallthrough],&nbsp;[dcl.attr.unus=
ed],&nbsp;[dcl.attr.nodiscard],&nbsp;[dcl.attr.noreturn]<br>They're all in =
notes and examples, but those are still part of the standard, and they say<=
br>things like "implementations should issue a warning" and "warning ... di=
scouraged".</div></div></div></div></div></div></div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups "=
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/CAHSYqdZcqvC4Len7ewSGr1cxVxaiknnU-mez=
QSYPmwGz4GsZiA%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdZcqvC4=
Len7ewSGr1cxVxaiknnU-mezQSYPmwGz4GsZiA%40mail.gmail.com</a>.<br>
</div></blockquote></div></body></html>

<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/E2DB90EB-4D96-49E6-8AD6-D235ADE418D1%=
40me.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/E2DB90EB-4D96-49E6-8AD6-D235ADE418D1%40m=
e.com</a>.<br />

--Apple-Mail-7FEE2F5F-86B0-40AB-BBDB-2B1B50AC458E--

.


Author: "'Alisdair Meredith' via ISO C++ Standard - Future Proposals" <std-proposals@isocpp.org>
Date: Mon, 08 Oct 2018 16:19:02 -0400
Raw View
--Apple-Mail-16A6CF4E-70EC-42A9-908E-8FBC117A8B20
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Doh! Attached reply to wrong email in this thread.

Sent from my iPhone

> On Oct 8, 2018, at 4:09 PM, 'Alisdair Meredith' via ISO C++ Standard - Fu=
ture Proposals <std-proposals@isocpp.org> wrote:
>=20
> See my previous post on =E2=80=98explicit operator bool=E2=80=99, that wo=
uld be useful for your implementation here, specifically avoiding the accid=
ental operator=3D=3D.
>=20
> AlisdairM
>=20
> Sent from my iPhone
>=20
>> On Oct 8, 2018, at 4:06 PM, Hyman Rosen <hyman.rosen@gmail.com> wrote:
>>=20
>>> On Mon, Oct 8, 2018 at 3:43 PM Thiago Macieira <thiago@macieira.org> wr=
ote:
>>> By the same token, warnings need not be discussed in this mailing list =
because=20
>>> they are not part of the C++ standard. They are QoI at best.
>>=20
>> That's not true.  I'm looking at N4741, and it mentions warnings in a nu=
mber of places:
>> [dcl.attr.fallthrough], [dcl.attr.unused], [dcl.attr.nodiscard], [dcl.at=
tr.noreturn]
>> They're all in notes and examples, but those are still part of the stand=
ard, and they say
>> things like "implementations should issue a warning" and "warning ... di=
scouraged".
>> --=20
>> You received this message because you are subscribed to the Google Group=
s "ISO C++ Standard - Future Proposals" group.
>> To unsubscribe from this group and stop receiving emails from it, send a=
n 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/iso=
cpp.org/d/msgid/std-proposals/CAHSYqdZcqvC4Len7ewSGr1cxVxaiknnU-mezQSYPmwGz=
4GsZiA%40mail.gmail.com.
>=20
> --=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=
 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/isoc=
pp.org/d/msgid/std-proposals/E2DB90EB-4D96-49E6-8AD6-D235ADE418D1%40me.com.

--=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/C3D971D3-D227-4740-8442-89C06ADF1E2F%40me.com.

--Apple-Mail-16A6CF4E-70EC-42A9-908E-8FBC117A8B20
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; charset=
=3Dutf-8"></head><body dir=3D"auto">Doh! Attached reply to wrong email in t=
his thread.<br><br><div id=3D"AppleMailSignature" dir=3D"ltr">Sent from my =
iPhone</div><div dir=3D"ltr"><br>On Oct 8, 2018, at 4:09 PM, 'Alisdair Mere=
dith' via ISO C++ Standard - Future Proposals &lt;<a href=3D"mailto:std-pro=
posals@isocpp.org">std-proposals@isocpp.org</a>&gt; wrote:<br><br></div><bl=
ockquote type=3D"cite"><div dir=3D"ltr"><meta http-equiv=3D"content-type" c=
ontent=3D"text/html; charset=3Dutf-8">See my previous post on =E2=80=98expl=
icit operator bool=E2=80=99, that would be useful for your implementation h=
ere, specifically avoiding the accidental operator=3D=3D.<div><br></div><di=
v>AlisdairM<br><br><div id=3D"AppleMailSignature" dir=3D"ltr">Sent from my =
iPhone</div><div dir=3D"ltr"><br>On Oct 8, 2018, at 4:06 PM, Hyman Rosen &l=
t;<a href=3D"mailto:hyman.rosen@gmail.com">hyman.rosen@gmail.com</a>&gt; wr=
ote:<br><br></div><blockquote type=3D"cite"><div dir=3D"ltr"><div dir=3D"lt=
r"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr"><div=
 class=3D"gmail_quote"><div dir=3D"ltr">On Mon, Oct 8, 2018 at 3:43 PM Thia=
go Macieira &lt;<a href=3D"mailto:thiago@macieira.org">thiago@macieira.org<=
/a>&gt; wrote:</div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0=
px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
By the same token, warnings need not be discussed in this mailing list beca=
use <br>
they are not part of the C++ standard. They are QoI at best.<br></blockquot=
e><div><br>That's not true.&nbsp; I'm looking at N4741, and it mentions war=
nings in a number of places:<br>[dcl.attr.fallthrough],&nbsp;[dcl.attr.unus=
ed],&nbsp;[dcl.attr.nodiscard],&nbsp;[dcl.attr.noreturn]<br>They're all in =
notes and examples, but those are still part of the standard, and they say<=
br>things like "implementations should issue a warning" and "warning ... di=
scouraged".</div></div></div></div></div></div></div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups "=
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/CAHSYqdZcqvC4Len7ewSGr1cxVxaiknnU-mez=
QSYPmwGz4GsZiA%40mail.gmail.com?utm_medium=3Demail&amp;utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdZcqvC4=
Len7ewSGr1cxVxaiknnU-mezQSYPmwGz4GsZiA%40mail.gmail.com</a>.<br>
</div></blockquote></div>

<p></p>

-- <br>
You received this message because you are subscribed to the Google Groups "=
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/E2DB90EB-4D96-49E6-8AD6-D235ADE418D1%=
40me.com?utm_medium=3Demail&amp;utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/E2DB90EB-4D96-49E6-8AD6-D235ADE418D1=
%40me.com</a>.<br>
</div></blockquote></body></html>

<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/C3D971D3-D227-4740-8442-89C06ADF1E2F%=
40me.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/C3D971D3-D227-4740-8442-89C06ADF1E2F%40m=
e.com</a>.<br />

--Apple-Mail-16A6CF4E-70EC-42A9-908E-8FBC117A8B20--

.


Author: olafvdspek@gmail.com
Date: Tue, 9 Oct 2018 05:36:28 -0700 (PDT)
Raw View
------=_Part_1821_1555662392.1539088589057
Content-Type: multipart/alternative;
 boundary="----=_Part_1822_1612486285.1539088589057"

------=_Part_1822_1612486285.1539088589057
Content-Type: text/plain; charset="UTF-8"

Op maandag 8 oktober 2018 19:40:49 UTC+2 schreef Andrew Sandoval:
>
> On Mon, Oct 8, 2018 at 2:15 AM <olaf@join.cc> wrote:
>
>>
>>
>> Other people think this kind of code should NOT be warned on by default
>> on all compilers and would be unhappy if the Standard mandated so..
>>
>> Olaf, can you elaborate on the reasons why this would be a problem for
> "other people"?
>

Most code using the constructs is simply correct.


> And is there any good reason why the Standard should not make strong
> recommendations on warning -- or at least on optional warnings and maybe
> why someone would choose to enable or disable them.
>

Yes, the committee has more important things to do. ;)


> I can argue that the current automatic / implicit conversion violates type
> safety.
>

What part of type safety does it violate?

--
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/5da5e6ac-6d30-47da-955f-dd3c8825c4ec%40isocpp.org.

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

<div dir=3D"ltr">Op maandag 8 oktober 2018 19:40:49 UTC+2 schreef Andrew Sa=
ndoval:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.=
8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div c=
lass=3D"gmail_quote"><div dir=3D"ltr">On Mon, Oct 8, 2018 at 2:15 AM &lt;ol=
af@join.cc&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"m=
argin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"l=
tr"><br><div><br></div><div>Other people think this kind of code should NOT=
 be warned on by default on all compilers and would be unhappy if the Stand=
ard mandated so..=C2=A0</div></div>

<p></p></blockquote></div><div>Olaf, can you elaborate on the reasons why t=
his would be a problem for &quot;other people&quot;?=C2=A0 </div></div></bl=
ockquote><div><br></div><div>Most code using the constructs is simply corre=
ct.=C2=A0</div><div>=C2=A0<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: =
1ex;"><div dir=3D"ltr"><div>And is there any good reason why the Standard s=
hould not make strong recommendations on warning -- or at least on optional=
 warnings and maybe why someone would choose to enable or disable them.</di=
v></div></blockquote><div><br></div><div>Yes, the committee has more import=
ant things to do. ;)=C2=A0</div><div>=C2=A0<br></div><blockquote class=3D"g=
mail_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc sol=
id;padding-left: 1ex;"><div dir=3D"ltr"><div></div><div>I can argue that th=
e current automatic / implicit conversion violates type safety.=C2=A0</div>=
</div></blockquote><div><br></div><div>What part of type safety does it vio=
late?=C2=A0</div></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/5da5e6ac-6d30-47da-955f-dd3c8825c4ec%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5da5e6ac-6d30-47da-955f-dd3c8825c4ec=
%40isocpp.org</a>.<br />

------=_Part_1822_1612486285.1539088589057--

------=_Part_1821_1555662392.1539088589057--

.