|
 |
Warp <war### [at] tag povray org> wrote:
> Darren New <dne### [at] san rr com> wrote:
> > Oh! OK. Heh. I don't think I've ever had the pleasure of needing or using
> > inner classes before, in any language, so it didn't leap out at me.
> Why not? It aids in limiting the visibility of types, and thus increases
> modularity. If a class uses a helper class which is completely exclusive
> to that class (and might even be a friend), then it makes sense that the
> helper class is defined as a private inner class.
Forgot to mention practical examples.
Ever wondered what, for example, std::list<int>::iterator is? Well,
surprisise surprise, it's an inner class inside std::list<int>. It's so
related to std::list that it makes a lot of sense to make it an inner class.
--
- Warp
Post a reply to this message
|
 |