A
Andrea Crotti
To my surprise I read that some time ago, so what I thought it could
work in fact it could not work.
Supposing I have two classes
class Base
friend operator<<(..)
// print base fields
class Extended : Base
Since the friend is not inherited I guess I have to declare it again,
but supposing I want to
- first call the << on the base class
- then call on the extended class
how should I do that?
A cast from the object itself ot it's base type?
work in fact it could not work.
Supposing I have two classes
class Base
friend operator<<(..)
// print base fields
class Extended : Base
Since the friend is not inherited I guess I have to declare it again,
but supposing I want to
- first call the << on the base class
- then call on the extended class
how should I do that?
A cast from the object itself ot it's base type?