473,473 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Covariance


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
1 1833
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Kalyan | last post by:
Hi All, I have the table as follows column1 ...
1
by: Tony Johansson | last post by:
Hello!! When you have result covariance is it then necessary that you have inheritance. I mean can you have result covariance without having inheritance. //Tony
0
by: Aryeh Holzer | last post by:
Let me start with a quote from the C# Programmers Reference (where I learned the cool word "covariance"): "When a delegate method has a return type that is more derived than the delegate...
1
by: Arkadiusz Stasiak | last post by:
I am looking for functions/library to calculate covariance matrix, eigenvectors, eigenvalues in Visual C++, as299@kent.ac.uk. Thanks
3
by: ollisalo | last post by:
Hi Firstly I'm quite a newbie in SQL, so apologies for any obvious stupid questions. My problem is that I have a large set of stock price data for different companies together with the stock...
0
by: rach | last post by:
I am testing the covariance return in C++. First the following code worked. class A { public: class X {}; virtual X* f() {return new X;} }; class B : public A {
2
by: mufenhsieh | last post by:
I am testing covariance return in C++. First the following code worked. class A { public: class X {}; virtual X* f() {return new X;} };
1
by: =?Utf-8?B?aGVyYmVydA==?= | last post by:
Jon Skeet wrote in the .NET general newsgroup 11/17/2005: "The difference between Invoke and DynamicInvoke is that the parameters to Invoke depend on the delegate itself - the method has the same...
2
by: Anders Borum | last post by:
Hello! I was wondering if anybody in this newsgroup are following the status of covariance in C#? As far as I'm concerned, generics covariance is not supported with C# 3.0 - unfortunately, as...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.