>PS: While your code might work on more recent versions of VC++, it won't VC++ 4.0 because of the private statement. And that version is a 32 bit compilter.
VC++ is not and has never been a fully conformal C++ compiler. The definition of a struct as a class has been part of C++ from the beginning. Although I grant that ALL structs in C++ that have member functions should be redefined as classes for consitency, the definition still stands. I am in no way advocating using structs in this manner and I never do so. I am pointing out that this is perfectly legal C++. The memory image of a C++ class is exactly like the memory image of a C++ struct, the code is not really coupled with the data in any manner except by the compiler durring the compilation. Name mangling creates C style functions that manipulate the memory image. This is why the original ATT C Front C++ compiler could be implimented as a C preprocessor.
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement