This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: verbose terminate() on by default, pass 2


Gabriel Dos Reis wrote:

>   01. Pointers and references
>     char* p = "flop";
>     char& c = *p;
>        -NOT-
>     char *p = "flop";  // wrong
>     char &c = *p;      // wrong
> 
>       Reason: In C++, definitions are mixed with executable code.  Here,       
>               p is being initialized, not *p.  This is near-universal
>               practice among C++ programmers; it is normal for C hackers
>               to switch spontaneously as they gain experience.

That's crap and an insult to every "C hacker" and those who really
understand the issue.

   char* p = "flop";

is wrong since the derefence does *not* belong to the type but instead
the variable as can be clearly seen in

   char* p, q;

Nathan was never ever able to justify the wrong C++ style sufficiently
and simply brushed over the issue by saying "then don't do it".  This is
just one more example of the arrogance of the C++ people who a) cannot
use what has been practice in the C world, and b) admit that they are wrong.

-- 
--------------.                        ,-.            444 Castro Street
Ulrich Drepper \    ,-----------------'   \ Mountain View, CA 94041 USA
Red Hat         `--' drepper at redhat.com `---------------------------


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]