Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > What operators cannot be virtual?

Reply
Thread Tools

What operators cannot be virtual?

 
 
moleskyca1@yahoo.com
Guest
Posts: n/a
 
      08-14-2006
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?

 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      08-14-2006
http://www.velocityreviews.com/forums/(E-Mail Removed) 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


 
Reply With Quote
 
 
 
 
tolgaceylanus@yahoo.com
Guest
Posts: n/a
 
      08-14-2006

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

 
Reply With Quote
 
Jim Langston
Guest
Posts: n/a
 
      08-15-2006
"Victor Bazarov" <(E-Mail Removed)> wrote in message
news:ebpv20$n9b$(E-Mail Removed)...
> (E-Mail Removed) 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.


 
Reply With Quote
 
Diego Martins
Guest
Posts: n/a
 
      08-15-2006

Jim Langston wrote:
> "Victor Bazarov" <(E-Mail Removed)> wrote in message
> news:ebpv20$n9b$(E-Mail Removed)...
> > (E-Mail Removed) 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!!!

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
why Cannot Overload the operators in C++ chenthil C++ 2 07-19-2009 09:49 AM
why Cannot Overload the operators in C++ chenthil C++ 0 07-17-2009 10:05 AM
why some operators cannot be overloaded Bangalore C++ 4 07-27-2005 03:31 PM
Operators that cannot be Overloaded - WHY? Brad Eck C++ 20 10-30-2004 02:41 PM
The file 'bin\WebProj.dll' cannot be copied to the run directory. The requested operation cannot be performed on a file with a user-mapped section open. J Gao ASP .Net 0 07-28-2003 04:18 PM



Advertisments