digitalmars.D - "Programming in D for C++ Programmers" mistake
- Sean Eskapp <eatingstaples gmail.com> Dec 02 2010
- Walter Bright <newshound2 digitalmars.com> Dec 02 2010
- Sean Eskapp <b1262505 prtnx.com> Dec 03 2010
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
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
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








Sean Eskapp <b1262505 prtnx.com>