Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

General Encapsulation vs Class Encapsulation

Name: Anonymous 2007-12-16 22:08

In general, what I am talking about is a general purpose alternative to private, that being hidden. This is a general purpose encapsulation that can be used anywhere, and it can't be accessed or redefined in sub-blocks. Consider what's below:

Global Scope
hidden int _hidden_static;
_hidden_static=0; //Fine
void some_func() {_hidden_static=0;} //Illegal


Local Scope
void some_func() {
    hidden int _hidden_local;

    _hidden_local=0;   //Fine
    {_hidden_local=0;} //Illegal
}


Class Scope
It is the same as private except that the members cannot be redefined in any scope, including the class methods. Any polymorphic method would of course have to be able to make an exception to the redefinition rule.

What do you think of this?

Name: Anonymous 2007-12-17 12:14

IT'S CALLED CONST YOU NIMWIT

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List