473,320 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

What operators cannot be virtual?

What operators cannot be virtual and why? I looked at FAQ and found
nothing.

I think there are operators that cannot be virtual, but I don't know
why?

Aug 14 '06 #1
4 1516
mo********@yahoo.com wrote:
What operators cannot be virtual and why?
Operators 'new' and 'delete' and 'new[]' and 'delete[]', because they
are essentially "static" (although not declared as such).
I looked at FAQ and found
nothing.
That's because it's not a Frequently Asked Question.
I think there are operators that cannot be virtual, but I don't know
why?
I believe you can think that because you suspect that you might not know
everything there is to know about C++. Quite understandable. I am the
same way, although not about overloaded operators.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Aug 14 '06 #2

FYI, the assignment operator can actually be declared virtual.
But this is unlikely to be useful since each class will have it's own
assignment operator with different type of parameter that has the same
type of the class itself.

Tolga Ceylan

Aug 14 '06 #3
"Victor Bazarov" <v.********@comAcast.netwrote in message
news:eb**********@news.datemas.de...
mo********@yahoo.com wrote:
>What operators cannot be virtual and why?

Operators 'new' and 'delete' and 'new[]' and 'delete[]', because they
are essentially "static" (although not declared as such).
>I looked at FAQ and found
nothing.

That's because it's not a Frequently Asked Question.
>I think there are operators that cannot be virtual, but I don't know
why?

I believe you can think that because you suspect that you might not know
everything there is to know about C++. Quite understandable. I am the
same way, although not about overloaded operators.

V
I find that hard to believe. I don't think I've seen a question you can't
answer V.
Aug 15 '06 #4

Jim Langston wrote:
"Victor Bazarov" <v.********@comAcast.netwrote in message
news:eb**********@news.datemas.de...
mo********@yahoo.com wrote:
What operators cannot be virtual and why?
Operators 'new' and 'delete' and 'new[]' and 'delete[]', because they
are essentially "static" (although not declared as such).
I looked at FAQ and found
nothing.
That's because it's not a Frequently Asked Question.
I think there are operators that cannot be virtual, but I don't know
why?
I believe you can think that because you suspect that you might not know
everything there is to know about C++. Quite understandable. I am the
same way, although not about overloaded operators.

V

I find that hard to believe. I don't think I've seen a question you can't
answer V.
C++ is huge!!! :-)

Aug 15 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Andy Jarrell | last post by:
I'm trying to inherit from a specific class that has an overloaded operator. The problem I'm getting is that certain overloaded operators don't seem to come with the inheritance. For example: ...
12
by: c++novice | last post by:
1--Can operators be virtual? 2--What is the difference between an operator= returning a refernce Vs a value?
3
by: N4M | last post by:
Dear, I have problems with overloaded operators ++() and --(). MSVC++ 6.0 compiler gives errors, one is shown as below: " c:\data\c++\mygraphs\graph.h(182) : error C2555: 'CGraphNodeIter::++' :...
17
by: Anoob | last post by:
Can we consider () unary operator when calling a function, in exps eq. f(), ( 1 + 2). But when we call function f( 10 ) it is a binary operator. Even if we pass f( 10, 20) as we are using ,...
5
by: Action | last post by:
does it works like ordinary virtual method?? coz I find that child class can't invoke the event of the parent class. class parent { public virtual event SomeDelegate SomeChanged; } class...
25
by: tsaar2003 | last post by:
Hi Pythonians, To begin with I'd like to apologize that I am not very experienced Python programmer so please forgive me if the following text does not make any sense. I have been missing...
13
by: olanglois | last post by:
Hi, I am trying to derive a new class that will add new functions but no new data members and the base class has overloaded operators (+,-,+=,-=,etc...) returning either (Base &) or (const Base)...
5
by: Shak | last post by:
Hi all. I was led to believe that static methods were not inherited by their subclasses (and since that makes sense, rightly so). However, a subclass I've written is using it's (abstract)...
2
by: gyarnell | last post by:
Just ran into a problem upgrading from GCC 2.96 to GCC 3.3.2. There is a bug somewhere, could be in 2.96, could be in 3.3.2, could be in the code I'm compiling. Here's a minimal example class A {...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.