I like to write my class declarations in a header file and defining it later on: either later on in the header if I want some things to be able to get inlined, or in a cpp. This way I can keep my class declarations tidy and easy on the eye.
However, I want to make a class inside a class (an iterator)
Is it possible to declare it inside a class and define it later on?
How?
Yes, you just need to add the name of the containing class and then the scope resolution operator,
::, and the name of the inner class, like thisThere is no (practical) limit to how many nested classes you can have, and you just keep adding
::to go further and further in.