covariant final interface functions

Steven Schveighoffer schveiguy at yahoo.com
Fri Mar 19 12:42:36 PDT 2010


On Fri, 19 Mar 2010 15:00:43 -0400, div0 <div0 at users.sourceforge.net>  
wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Steven Schveighoffer wrote:
>> In C++ this is not possible, because it does not consider that you can  
>> return a pointer to
>> something that is both a C and a D at the same time.
>
> FYI, not true. C++ does support covariant returns.
> Even back as far as visual studio 2003.

I stand corrected.  I just never knew about it ;)

http://en.wikipedia.org/wiki/Covariance_and_contravariance_%28computer_science%29

-Steve



More information about the Digitalmars-d mailing list