I once planned to do everything with forward declarations, hoping it would be a universal solution.But how do I do this with classes that use templates?
Oh well, if I can't I can't. I can make an exception in that case if I have to.
I once planned to do everything with forward declarations, hoping it would be a universal solution.But how do I do this with classes that use templates?
Oh well, if I can't I can't. I can make an exception in that case if I have to.
"The strength of a civilization is not measured by its ability to wage wars, but rather by its ability to prevent them." - Gene Roddenberry
Don't make it a general rule to use forward declarations. It can be used in many many cases, but sometimes it is simply very usefull to include the actual header file.
With templates, you can be in luck depending on the implementation. As the template functions are only expanded when called, the conflict may or may not be there. If you do have problems, you should either unlink the two classes, or make a 'master' class which handles the communication between the two classes. I probably don't have to advise you to prevent 2 classes being linked to eachother![]()
Bookmarks