Changes between Version 8 and Version 9 of CodingGuidelines


Ignore:
Timestamp:
Mar 29, 2012, 10:29:01 AM (13 years ago)
Author:
FrederikHeber
Comment:

enhanced section on const members with mutable keyword

Legend:

Unmodified
Added
Removed
Modified
  • CodingGuidelines

    v8 v9  
    117117The same holds for variables. If they are set in the constructor and only read afterwards, make them __const__.
    118118
    119 ''Note: const variables are tricky with [http://www.boost.org/libs/serialization serialization], but in this specific case it is allowed to use '''const_cast<>()''' to allow writing a const member variable outside the constructor.''
     119''Note:'' const variables are tricky with ''[http://www.boost.org/libs/serialization serialization]'', but in this specific case it is allowed to use '''const_cast<>()''' to allow writing a const member variable outside the constructor.
     120
     121''Note:'' If a function is ''const in nature'' but modifies a very specific variable (specific to the function but needs to be contained in the class scope, e.g. a counter how often the function has been called), make it __mutable___.