Visibility of class members

Top  Previous  Next

What is partially translated > Visibility of class members


In Delphi a private or protected member is visible anywhere in the module where its class is declared. In C++ a private or protected member is visible only in the class. So the tranlation makes all classes in the same module to friends of each other. But as problem remains, that an access to these elements from code in the same unit, but outside of the class is forbidden in C++.

In Delphi Members at the beginning of a VCL class declaration that donít have a specified visibility are by default published and in other classes they are public. In C++ this is written explicit.

(Delphi2Cpp ignores the {$M+} directive, which would make them public.)




This page belongs to the Delphi2Cpp Documentation

Delphi2Cpp home  Content