I came across this code.
class SomeClass::OtherClass : public BaseClass
{
// stuff in here
}
SomeClass is a class, so maybe OtherClass is a class that exists inside the scope of SomeClass? I’ve just never seen it done this way.
So, is that what it means?
Give yourself a checkmark. That is what it means.
This is used to subsequently define
OtherClassafter it was declared insideSomeClass:One might do this if the inner class only makes sense in the context of the exterior class.
As mentioned elsewhere, the pimpl idiom is an excellent use of inner classes with deferred definition.