Yeah, you're in a trap...
You'll have to re-structure. What you are saying is: A requires B, which requires B first, which requires A first...
Re: Yeah, you're in a trap...
Quote:
Originally posted by DougDbug
You'll have to re-structure. What you are saying is: A requires B, which requires B first, which requires A first...
not nessicarily.
He didn't say they encapsulated each other or that they recursively constructed each other. It's perfectly fine (and often necissary) to need data about both. If you only need a pointer to an instance of the class, then you dont need the class definition, just a forward declaration. If you need to use specific functions/datamembers, put all of the implementation in a cpp and include both headers in the cpp.