Here is the problem i've got:
Currently I have sever classes Named Node:
- one for the 3d scene importer/exporter
- one for the "current state" of an instance of an animated 3d scene.
- one for the editor
- any probably another one somewhere.
Currently I resolve these by using "local namespaaces aka:
namespace Scene3D { struct Node .. }
namespace EvaluateScene { struct Node ... }
namespace EditorUtils { struct Node ...}
This sure works, but i really do not like. To be honest I do not like namespaces at all. I really they do not work that wall in C++ (expecially when you try mising using <namespace> in the cpp with not using namespace in the header.
It just gets to messy because in the implementation of Scene3D im referring to the Node struct just by using "Node" but outside i use Scene3D::Node. And it gets even messier when I have to use Scene3D::Node in namespace EvaluateScene - it just get absoletley bananas.
Not to mention that forward declarations get messy too.
I'm thinking about switching to "prefixes" actually I resolve a few similar collisions in my code base like that, but the names are getting too long(but i think i prefer it).
nested classes/structs are not an option as they prevent me to forward declare.
Do you have the same problem?
How do you solve it?