quote:Original post by Cedricquote:Original post by CProgrammer
When is it generally good to use the inline command?
1. Don''t.
2. (For experts) Not yet.
3. If you really want to, profile first, and look try it for yourself. You can get some marginal gains that way.quote:In my opinion, the inline mechanism is of great importance in the support of encapsulation/information hiding and the design of abstract data types
How do you support that opinion? What you wrote doesn''t make sense to me, but I don''t know you...
Cédric
Wrong. Using the inline keyword isn''t necessarily an optimization. It''s a way of telling the compiler "yes, this function is in the header file. Don''t complain about it being present int multiple object files."
Having small member functions like getters/setters in your header without the inline keyword might work for you on your compiler anyways, but don''t take it for granted.