operator overloading and virtual funtions

Discussion in 'C++' started by ravinderthakur@gmail.com, Jan 30, 2006.

  1. Guest

    hi all experts,

    i was just thinking about making overloaded operators virtual. i was
    wordering what could be the
    implications of such scenarios.


    i will be thankful if somebody can provide point out some general
    issues in making overloaded virtual or point me to some resource
    having explaination about the same.



    thanks
    ravinder.
     
    , Jan 30, 2006
    #1
    1. Advertising

  2. On 30 Jan 2006 04:56:52 -0800, wrote:

    >hi all experts,
    >
    >i was just thinking about making overloaded operators virtual. i was
    >wordering what could be the
    >implications of such scenarios.
    >
    >
    >i will be thankful if somebody can provide point out some general
    >issues in making overloaded virtual or point me to some resource
    >having explaination about the same.


    Have you read the FAQ yet?
    http://www.parashift.com/c -faq-lite/operator-overloading.html

    Don't forget that there is a difference between overloading and
    overriding. Overloaded functions (or operators) take different
    arguments, but they are in the same class or namespace. However,
    virtual functions need to be overridden, which means they have to take
    the same arguments in the derived class as in the base class. If you
    truly overload a virtual function or operator by providing different
    arguments, you will likely end up hiding the base class virtual
    function or operator.

    --
    Bob Hairgrove
     
    Bob Hairgrove, Jan 30, 2006
    #2
    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. Matthew Hood

    How to create global Funtions & Routines

    Matthew Hood, Jun 24, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    1,927
    Matthew Hood
    Jun 25, 2003
  2. matthias_k
    Replies:
    13
    Views:
    586
    Matthias
    Jan 26, 2005
  3. hula

    static funtions

    hula, Jan 13, 2007, in forum: Java
    Replies:
    4
    Views:
    369
    Steve
    Jan 17, 2007
  4. Paminu

    Help funtions in a seperate file??

    Paminu, Oct 16, 2005, in forum: C Programming
    Replies:
    3
    Views:
    278
    Malcolm
    Oct 16, 2005
  5. dios de la oscuridad

    i got a prOblem, OF FUNTIONS

    dios de la oscuridad, Aug 18, 2005, in forum: C++
    Replies:
    1
    Views:
    282
    Victor Bazarov
    Aug 18, 2005
Loading...

Share This Page