C++

Takket været David R. Tribble fattede jeg endeligt const modifieren i C++ som en read-only markør.

A reference variable or constant declared as const refers to an object that cannot be modified. The reference variable itself can be modified (if it is not declared final), but the referrent object cannot be modified. Thus the const specifier applies to the value of the object referenced by the variable.

An object is modified whenever any of its accessible member variables are the subject of an assigment (or compound assignment) or increment/decrement operator. An object is also considered modified whenever a call is made to any of its member methods that are not declared const