inline, templates,

Discussion in 'C++' started by vsgdp, Aug 2, 2006.

  1. vsgdp

    vsgdp Guest

    If I define a member function inside the class definition, it is
    automatically inlined correct (or at least hinted to the compiler to make
    inline)? When defining a template class, you usually have to define all the
    methods in the header file (not necessarily in the class definition though),
    but if they are defined in the class definition, they will be (hinted) to be
    inlined as well?
     
    vsgdp, Aug 2, 2006
    #1
    1. Advertising

  2. vsgdp

    mlimber Guest

    vsgdp wrote:
    > If I define a member function inside the class definition, it is
    > automatically inlined correct (or at least hinted to the compiler to make
    > inline)?


    Yes.

    > When defining a template class, you usually have to define all the
    > methods in the header file (not necessarily in the class definition though),
    > but if they are defined in the class definition, they will be (hinted) to be
    > inlined as well?


    Yes. Cf.
    http://www.parashift.com/c -faq-lite/templates.html#faq-35.12.

    Cheers! --M
     
    mlimber, Aug 2, 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. Abhi
    Replies:
    2
    Views:
    742
    E. Robert Tisdale
    Jul 3, 2003
  2. JKop
    Replies:
    3
    Views:
    479
  3. Alvin
    Replies:
    7
    Views:
    480
    E. Robert Tisdale
    May 6, 2005
  4. Replies:
    3
    Views:
    461
  5. recover
    Replies:
    2
    Views:
    813
    recover
    Jul 25, 2006
Loading...

Share This Page