declaring class member functions as friend without full class definition

H

Hicham Mouline

Hello,

I am attempting to change a existing large code base and I have this
situation:

A.hpp
class A {
....
friend void B::member_function1() const;
...
};


When I include B.hpp for the definition of B, I seem to fall in
cross-include situation where the include guards
don't work (or work bad...)

I tried forward declaring class B before A, but it seems the full definition
of B is required
to declare its member function as a friend to A.

Is there a solution to this?

regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top