Jump to content
  • Advertisement


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

Geoff the Medio

inline / const function declaration

This topic is 5554 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
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

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!