Sujet : Re: question about nullptr
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 08. Jul 2024, 10:08:53
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v6gab6$qdd2$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 08.07.2024 09:19, Kaz Kylheku wrote:
On 2024-07-07, Ben Bacarisse <ben@bsb.me.uk> wrote:
I find myself completely out of step with many posters here about
"explicit code" should look like. I think
>
char *p = 0;
>
is explicit enough and, in fact, I consider it a plus point if someone
reading it goes "hey, what's going on here?" and ends up learning that 0
is null pointer constant in C.
And if that person is on the C or C++ langauge committee, that bit of
learning could just prevent a superfluous non-invention like nullptr.
What's superfluous to one is useful for others (e.g. for grep'ing
occurrences of a null-pointer value in source codes); if it's not
defined in a standard it gets explicitly defined individually, and
then likely in different (non-uniform, non-standard) ways.
To me it's more likely that because of that it had been deliberately
added to support such desires, and less likely that the C-standards
folks need to learn "C" and wouldn't know what 0 as a pointer value
would mean or that it has a clear semantic in such pointer contexts.
Janis