I have a need for defining an integer constant that'll be used for
initializing a member variable of a private class.

The Qt coding conventions (http://qt-project.org/wiki/Coding-Conventions)
recommend using an enum over 'const int'.

The rationale given there is that an enum will be replaced at compile-time
resulting in 'faster code'. Won't that be the case with 'const int' as
well? I think a 'const int' will be inlined in the code. CMIIW.

Also, there are a couple of instances in our current code where such
(static and non-static) constants are used. Whats the recommended way?

Thanks,
-mandeep
_______________________________________________
Development mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to