On 21/02/2011 20:18, Jonathan Bromley wrote:
> - Define covariant return types thus:
> Consider a class C having some virtual method F with a return or
> output-argument type T1. If C is assignment-compatible with T1 then
> an overloaded definition of F, in any class D that is *derived from*
> C, may replace type T1 with a different type T2 provided that D is
> assignment-compatible with T2. An argument or return type that has
> been replaced in this manner in a derived class is a /covariant/ type.
Curses, I can see an error straight away. Should be "an overloaded
definition of F, in any class D that is *assignment-compatible with* C"
to cope with the possibility that C is an interface class and D
implements it. (I assume this would also be a candidate for covariance?)
-- Jonathan Bromley -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Mon Feb 21 12:29:06 2011
This archive was generated by hypermail 2.1.8 : Mon Feb 21 2011 - 12:29:09 PST