inline, templates,

V

vsgdp

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?
 
M

mlimber

vsgdp said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,470
Messages
2,571,809
Members
48,797
Latest member
PeterSimpson
Top