0

I want to allow a private method defined in class A to call a private method defined in class B. I cannot declare a single friend method because class B's definition is already known by A (A already uses B), and including A's header in B would go circular. Nor can I simply use a forward declaration, as explained here:

MSDN: Friend declarations

I'm currently declaring A as a private friend of B, which exposes everything in B and is less desirable. The article above has an intriguing teaser at the end:

"Although the entire second class must be a friend to the first class, you can select which functions in the first class will be friends of the second class."

I can't find a way to do this - is it possible?

greenback
  • 1,506
  • 2
  • 17
  • 29

0 Answers0