I was wondering if when one class from one header declares another class from a different header as a friend does the class prototype go befor or after the macro guard? Also do i need to include the friended class header?
Thank you and sorry if this question has already been answered; but i couldn't find a clear answer.
But can you say if the forward declaration should come befor or after the macro guard inside the friending class header?
It's tidier to declare the forward definition within the header guard, and there's no point getting the compiler code to parse code unnecessarily, but at the end of the day it doesn't really matter. You can have as many declarations as you want, as long as you only have a single definition. http://en.wikipedia.org/wiki/One_Definition_Rule