I was going through a old code written by someone i encountered one class defined as
class SomenameofClass::Someanothername of the class
{
//some code goes here
};
what does it mean ? does it signifies private inheritance ?
I was going through a old code written by someone i encountered one class defined as
class SomenameofClass::Someanothername of the class
{
//some code goes here
};
what does it mean ? does it signifies private inheritance ?
This is the definition of a nested class which was declared elsewhere like this:
class SomenameofClass
{
class Someanothername;
};
Usually this is done when the nested class is only used in the implementation of the outer class, so its definition doesn't need to be exposed in a header file.
Nested classes are considered to be within the scope of the enclosing class and are available for use within that scope. To refer to a nested class from a scope other than its immediate enclosing scope, you must use a fully qualified name.
Its nested class, these are used to avoid name conflicts among different scopes. If a class is used by only one class, nest it, it will avoid naming conflicts and you will be notified if there is any conflict by intellisense