Synopsis: | A pointer or reference parameter should be declared const if the function does not change the object bound to it |
Language: | C++ |
Severity Level: | 4 |
Category: | Class Interface |
Description: |
Note that what is meant is: the pointee, instead of the pointer, should be declared const if appropriate. See also [INT#020]. void f(const int* ptr); // okay: pass ptr to a const int void f(const int& ref); // okay: pass ref to a const int |