471,594 Members | 2,011 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,594 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 1412
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Andy Jarrell | last post: by
12 posts views Thread by c++novice | last post: by
3 posts views Thread by N4M | last post: by
5 posts views Thread by Shak | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Anwar ali | last post: by

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.