http://www.parashift.com/c++-faq-lite/templates.html#faq-35.16 describes two ways of solving the "call to non-template" error. This error gets thrown when one defines a template class with some friend operator(s) declared in a natural manner, not thinking that declaring the template friend(s) like this will resolve the method into a non-template one. I find the first method of pre-declaring the operator to be tiresome and the second i say it can make the class definition unreadable if the operator definition is complex. I'm going to choose a third way of defining template friends:
Showing posts with label object oriented programming. Show all posts
Showing posts with label object oriented programming. Show all posts
implicit, may-be-safe super.__init__ call on derived class instantiation: a starting point
What do I really understand by inheritance? I mean, what is to be inherited?
I would say it is behavior ... and that would be enough. It's a sane way to propagate knowledge. You don't want to inherit data from your ancestors other way than compiled as carefully selected behaviors that will eventually help you interpret a live information stream and that you can upgrade to something well suited for your existence.
I would say it is behavior ... and that would be enough. It's a sane way to propagate knowledge. You don't want to inherit data from your ancestors other way than compiled as carefully selected behaviors that will eventually help you interpret a live information stream and that you can upgrade to something well suited for your existence.
Subscribe to:
Comments (Atom)