What operators cannot be virtual?

Discussion in 'C++' started by moleskyca1@yahoo.com, Aug 14, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. 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
    Victor Bazarov, Aug 14, 2006
    #2
    1. Advertising

  3. Guest

    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, 2006
    #3
  4. Jim Langston Guest

    "Victor Bazarov" <> wrote in message
    news:ebpv20$n9b$...
    > 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.
    Jim Langston, Aug 15, 2006
    #4
  5. Jim Langston wrote:
    > "Victor Bazarov" <> wrote in message
    > news:ebpv20$n9b$...
    > > 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!!! :)
    Diego Martins, Aug 15, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. c++novice
    Replies:
    6
    Views:
    6,636
    c++novice
    Apr 8, 2004
  2. Brad Eck
    Replies:
    20
    Views:
    46,132
    Alex Vinokur
    Oct 30, 2004
  3. Bangalore
    Replies:
    4
    Views:
    1,242
    Fabio Fracassi
    Jul 27, 2005
  4. Calum
    Replies:
    7
    Views:
    338
    Calum
    Mar 14, 2006
  5. Jörg Rolef

    Virtual overloading of operators

    Jörg Rolef, Apr 26, 2010, in forum: C++
    Replies:
    4
    Views:
    791
Loading...

Share This Page