www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - "Programming in D for C++ Programmers" mistake

reply Sean Eskapp <eatingstaples gmail.com> writes:
There's a significant issue in the "Programming in D for C++ Programmers"
article (http://www.digitalmars.com/d/2.0/cpptod.html)

The Struct Comparison section is quite wrong. In C++, most structs/classes
automatically generate comparison operators. Also, these comparison operators
are member functions of the struct, not external functions.
Dec 02 2010
parent reply Walter Bright <newshound2 digitalmars.com> writes:
Sean Eskapp wrote:
 There's a significant issue in the "Programming in D for C++ Programmers"
 article (http://www.digitalmars.com/d/2.0/cpptod.html)
 
 The Struct Comparison section is quite wrong. In C++, most structs/classes
 automatically generate comparison operators. Also, these comparison operators
 are member functions of the struct, not external functions.
I believe the page is correct. Can you show me in the C++98 Standard where it says otherwise?
Dec 02 2010
parent Sean Eskapp <b1262505 prtnx.com> writes:
I'm sorry, it must have been some form of nonstandard extension I used! I see
now
that this fails with gcc.
Dec 03 2010