-
June 17th, 2011, 11:18 AM
#1
Friendship and circular dependencies
Hello, I would like to know how I could solve the following circular dependency.
class_A.h
------------
#include "../include/class_B.h"
class class_A
{
public:
...
friend void class_B::funct();
};
class_B.h
------------
#include "../include/class_A.h"
class class_B
{
public:
...
void funct();
...
private:
class_A temp;
};
As already suggested to me, a forward declaration doesn´t seem to work. If I insert it in file "class_A.h" then the compiler does not know the member function class_B::funct, and if I insert it in file "class_B.h" the compiler does not know the object class_A.
Thanks a lot in advanced!!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|