• Advertisement

Archived

This topic is now archived and is closed to further replies.

inline / const function declaration

This topic is 5372 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Does the order in which keywords appears in a function definition make any difference? ie. what''s the effect of switching between: inline int const getWidth() { return width; }; inline int getWidth() const { return width; }; const inline int getWidth() { return width; }; or any other valid orderings?

Share this post


Link to post
Share on other sites
Advertisement
Well,
inline int getWidth() const;
means that the ''this'' pointer is const, and so the function does not change the object. However, the other two mean that the return value is a const int.

Share this post


Link to post
Share on other sites

  • Advertisement