Topic: Is there anything wrong with "*nullptr" returning


Author: sbh <shubin.hu@gmail.com>
Date: Wed, 4 Oct 2017 04:47:44 -0700 (PDT)
Raw View
------=_Part_783_1495066692.1507117664294
Content-Type: multipart/alternative;
 boundary="----=_Part_784_1363284290.1507117664294"

------=_Part_784_1363284290.1507117664294
Content-Type: text/plain; charset="UTF-8"


Just curious.

--
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/25545dc9-94d1-484f-9d34-49534dd7b3b7%40isocpp.org.

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

<br><div>Just curious.</div><div><br></div>

<p></p>

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

------=_Part_784_1363284290.1507117664294--

------=_Part_783_1495066692.1507117664294--

.


Author: =?UTF-8?Q?Daniel_Kr=C3=BCgler?= <daniel.kruegler@gmail.com>
Date: Wed, 4 Oct 2017 13:59:05 +0200
Raw View
2017-10-04 13:47 GMT+02:00 sbh <shubin.hu@gmail.com>:
>
> Just curious.

void is a type where you cannot form a reference to. So why should
*nullptr return void&?

- Daniel

--
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/CAGNvRgDwacRHyLZ9tjnqSHy3ymaB9j1FUAToCOZyNvA-B4r1vg%40mail.gmail.com.

.


Author: Anthony Williams <anthony.ajw@gmail.com>
Date: Wed, 4 Oct 2017 13:00:03 +0100
Raw View
On 04/10/17 12:47, sbh wrote:
>
> Just curious.

Dereferencing any null pointer value is undefined behaviour. By
preventing dereferencing nullptr this therefore avoids some causes of bugs.

Anthony
--
Author of C++ Concurrency in Action     http://www.stdthread.co.uk/book/
just::thread C++11 thread library             http://www.stdthread.co.uk
Just Software Solutions Ltd      https://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

--
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/c6e6b3b3-5a7b-2949-150b-5c126af2b343%40gmail.com.

.


Author: Magnus Fromreide <magfr@lysator.liu.se>
Date: Wed, 4 Oct 2017 20:23:49 +0200
Raw View
On Wed, Oct 04, 2017 at 04:47:44AM -0700, sbh wrote:
>
> Just curious.

I would consider it surprising,

The type of nullptr is std::nullptr_t and that is explicitly not a pointer
type so as it currently stand *nullptr is a compilation error. nullptr is
modeled after the c++03 construct

0

and i think you would agree that

*0

is an unreasonable construct and from that follows that

*nullptr

also is unreasonable.

What do you think would be better by defining *nullptr ?

--
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/20171004182336.GA1708%40fukushima.lysator.liu.se.

.


Author: Vishal Oza <vickoza@gmail.com>
Date: Wed, 4 Oct 2017 11:59:03 -0700 (PDT)
Raw View
------=_Part_8787_1150658262.1507143543729
Content-Type: multipart/alternative;
 boundary="----=_Part_8788_688023682.1507143543729"

------=_Part_8788_688023682.1507143543729
Content-Type: text/plain; charset="UTF-8"

I agree with Anthony Williams that dereferancing a nullptr is undefined
behavior and there is no such thing as a void type therefore this code is
an error

On Wednesday, October 4, 2017 at 6:47:44 AM UTC-5, sbh wrote:
>
>
> Just curious.
>
>

--
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/c88da4cc-84a0-4c53-b88d-c461a93964b9%40isocpp.org.

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

<div dir=3D"ltr">I agree with Anthony Williams that dereferancing a nullptr=
 is undefined behavior and there is no such thing as a void type therefore =
this code is an error<br><br>On Wednesday, October 4, 2017 at 6:47:44 AM UT=
C-5, sbh wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-=
left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><br><div>Just c=
urious.</div><div><br></div></blockquote></div>

<p></p>

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

------=_Part_8788_688023682.1507143543729--

------=_Part_8787_1150658262.1507143543729--

.


Author: shubin.hu@gmail.com
Date: Wed, 4 Oct 2017 16:11:42 -0700 (PDT)
Raw View
------=_Part_9116_11107829.1507158702816
Content-Type: multipart/alternative;
 boundary="----=_Part_9117_1023744333.1507158702817"

------=_Part_9117_1023744333.1507158702817
Content-Type: text/plain; charset="UTF-8"

Would "void&" be helpful in some cases of template argument deduction?

If void is a type, syntactic sugar like "void&" could be useful, just like
nullptr.


On Wednesday, 4 October 2017 22:47:44 UTC+11, sbh wrote:
>
>
> Just curious.
>
>

--
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/5495e56b-3503-4ad8-ae53-d7fecd548b10%40isocpp.org.

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

<div dir=3D"ltr">Would &quot;void&amp;&quot; be helpful in some cases of te=
mplate argument deduction?<div><br></div><div>If void is a type, syntactic =
sugar like &quot;void&amp;&quot; could be useful, just like nullptr.</div><=
div><br></div><div><br>On Wednesday, 4 October 2017 22:47:44 UTC+11, sbh  w=
rote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8e=
x;border-left: 1px #ccc solid;padding-left: 1ex;"><br><div>Just curious.</d=
iv><div><br></div></blockquote></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/5495e56b-3503-4ad8-ae53-d7fecd548b10%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/5495e56b-3503-4ad8-ae53-d7fecd548b10=
%40isocpp.org</a>.<br />

------=_Part_9117_1023744333.1507158702817--

------=_Part_9116_11107829.1507158702816--

.


Author: Vishal Oza <vickoza@gmail.com>
Date: Wed, 4 Oct 2017 16:48:41 -0700 (PDT)
Raw View
------=_Part_8801_1166409582.1507160921484
Content-Type: multipart/alternative;
 boundary="----=_Part_8802_320716584.1507160921485"

------=_Part_8802_320716584.1507160921485
Content-Type: text/plain; charset="UTF-8"

Check out void_t by Walter Brown. He is "retired not dead". Inside joke but
that is there to cover template argument deduction.

On Wednesday, October 4, 2017 at 6:11:42 PM UTC-5, shub...@gmail.com wrote:
>
> Would "void&" be helpful in some cases of template argument deduction?
>
> If void is a type, syntactic sugar like "void&" could be useful, just like
> nullptr.
>
>
> On Wednesday, 4 October 2017 22:47:44 UTC+11, sbh wrote:
>>
>>
>> Just curious.
>>
>>

--
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/e662371c-129a-4e03-b482-603ef2cb53ab%40isocpp.org.

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

<div dir=3D"ltr">Check out void_t by Walter Brown. He is &quot;retired not =
dead&quot;. Inside joke but that is there to cover template argument deduct=
ion.<br><br>On Wednesday, October 4, 2017 at 6:11:42 PM UTC-5, shub...@gmai=
l.com wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-lef=
t: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr">W=
ould &quot;void&amp;&quot; be helpful in some cases of template argument de=
duction?<div><br></div><div>If void is a type, syntactic sugar like &quot;v=
oid&amp;&quot; could be useful, just like nullptr.</div><div><br></div><div=
><br>On Wednesday, 4 October 2017 22:47:44 UTC+11, sbh  wrote:<blockquote c=
lass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #c=
cc solid;padding-left:1ex"><br><div>Just curious.</div><div><br></div></blo=
ckquote></div></div></blockquote></div>

<p></p>

-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals&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/e662371c-129a-4e03-b482-603ef2cb53ab%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/e662371c-129a-4e03-b482-603ef2cb53ab=
%40isocpp.org</a>.<br />

------=_Part_8802_320716584.1507160921485--

------=_Part_8801_1166409582.1507160921484--

.