Inline virtual method

Discussion in 'C++' started by olegerm, Sep 23, 2004.

  1. olegerm

    olegerm Guest

    Does anybody know can a virtual method be inline?
    Please explain.
    Thank you.
     
    olegerm, Sep 23, 2004
    #1
    1. Advertising

  2. olegerm

    Sharad Kala Guest

    "olegerm" <> wrote in message

    > Does anybody know can a virtual method be inline?


    Of course, it can.

    > Please explain.


    If you invoke a virtual member function on an entity whose dynamic type is
    known to compiler then it can go ahead and inline it. E.g. when you invoke
    it on an object (and not base class pointer/reference), then compiler knows
    the static and dynamic types and can inline the call, of course if it wishes
    to do so!

    Sharad
     
    Sharad Kala, Sep 23, 2004
    #2
    1. Advertising

  3. olegerm

    olegerm Guest

    Thank you.

    "Sharad Kala" <> wrote in message news:<>...
    > "olegerm" <> wrote in message
    >
    > > Does anybody know can a virtual method be inline?

    >
    > Of course, it can.
    >
    > > Please explain.

    >
    > If you invoke a virtual member function on an entity whose dynamic type is
    > known to compiler then it can go ahead and inline it. E.g. when you invoke
    > it on an object (and not base class pointer/reference), then compiler knows
    > the static and dynamic types and can inline the call, of course if it wishes
    > to do so!
    >
    > Sharad
     
    olegerm, Sep 23, 2004
    #3
    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. Abhi
    Replies:
    2
    Views:
    751
    E. Robert Tisdale
    Jul 3, 2003
  2. jlopes
    Replies:
    7
    Views:
    433
    jlopes
    Nov 19, 2004
  3. Alvin
    Replies:
    7
    Views:
    489
    E. Robert Tisdale
    May 6, 2005
  4. Replies:
    3
    Views:
    473
  5. Daniel Vallstrom
    Replies:
    2
    Views:
    1,943
    Kevin Bracey
    Nov 21, 2003
Loading...

Share This Page