Inlining accessors
Posting a lot today huh?
Does the following get inlined automatically?
const unsigned char GetXRelative(void) const { return m_Xunits; }
or would I need to specify the inline keyword to provide futher hinting to the compiler?
Thanks
Chris Brodie
Depends where it is. If it''s inside a class declaration, then it''s called ''implicitly inlined'', and gets inlined automatically. If it''s a global function, then it''s up to the compiler. Using inline doesn''t ensure that it''ll be inlined, but it usually will be if the code is simple enough (no recursion or huge loops).
Morbo
Morbo
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement