1

https://stackoverflow.com/a/365349/5455629

Here the user says

// we derive privately, so the base-class wouldn't notice that, 
// (even though it's the base itself!), so we need a friend declaration
// to make the base a friend of us.

Is there any documentation available for the same. I could find it. Thanks.

PS : I can't add comment to that answer, as I am new here, and don't have sufficient reputation.

Community
  • 1
  • 1
q126y
  • 1,589
  • 4
  • 18
  • 50
  • You don't need the `friend` declaration. You can use a C cast in the base class and it will work without it: `((Derived*)this)->getSomething()`. This is due to special wording in expr.cast/4. – Simple Oct 23 '15 at 10:53

0 Answers0