Wiki Markup |
---|
Immutable objects should be {{const}}\-qualified. Enforcing invariants such as object immutability using existing {{const}}\-qualification helps ensures the correctness and security of applications. For example, ISO/IEC PDTR 24772 \[[ISO/IEC PDTR 24772|AA. C References#ISO/IEC PDTR 24772]\], for example, recommends labeling parameters as constant to avoid the unintentional modification of function arguments. |
const
-qualified objects. Constants include integer constants, floating constantsenumeration constants, and character constants
. |
Immutable (constant) values should be declared as const
-qualified objects (unmodifiable lvalues), macro definitions using #define
, or enumeration constants.
...