my question is how often do You really use nested classes in Your practice and in which cases? what is the real power of the nested classes, what can’t be done without them?
P.S. please don’t explain what is it, I know it (from technical point of view)
my question is how often do You really use nested classes in Your practice
Share
I usually use nested classes to embed finders objects (to use with
std::find_if) into my specific types.Something like:
Then:
This could of course be done without the use of nested classes. But I find it quite elegant because the finder has no use outside of the class definition:
If I ever delete the class in case of code-refactoring the finder should be deleted as well.