Hi !
I've been philosophizing about where to draw the line when it comes to encapsulation. It seems to me that when a class needs to contain data types that would preferably be forward declared in the header file, it would be most beneficial to just forward declare one structure to hold all of its member variables.
The way I see it, this first of all reduces the number of dynamic allocations needed to just one. It reduces the amount of redundant information visible through the class interface and nearly eliminates the need to recompile any file that is dependent of the class.
Does this seem like sound design? I'm curious to know why it is not a more common practice.
- Dave