By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,486 Members | 1,694 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,486 IT Pros & Developers. It's quick & easy.

Covariance

P: n/a

Hello all,

I had thought that both return types and parameter types of virutal
functions could be covariant. However, looking in the Standard (electronic
search), I find reference to only return types being allowed to be covariant
(10.3/5). Also, I thought I remembered the notion of contravariance
existing as well, but I don't find that either. Can anybody point me to the
relevant sections that address these issues?

Thanks!
Dave
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Dave wrote:
I had thought that both return types and parameter types of virutal
functions could be covariant. However, looking in the Standard (electronic search), I find reference to only return types being allowed to be covariant (10.3/5). Also, I thought I remembered the notion of contravariance
existing as well, but I don't find that either. Can anybody point me to the relevant sections that address these issues?


A method's "signature" everything from its name to the right.

Signatures bind at compile time, before virtual method lookup at runtime.

So only virtual method lookup can covariate.

--
Phlip
http://industrialxp.org/community/bi...UserInterfaces
Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.