TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
C++ Coding Standard
Search

Rule:  INT#022Checked automatically with code checker

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


Literature References:
ISC++ Rule 7.8