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

Rule:  INT#020Checked automatically with code checker

This rule is Obsolete
Synopsis:Pass arguments of non-simple types by reference or pointer
Language:C++
Severity Level:7
Category:Class Interface


Description:

Passing classes or structures by value is often costly because copies are made. So use references or pointers. Use the const keyword if the object is not allowed to change.

If there is a choice, prefer references over pointers to pass function arguments. The function can safely assume that ? as ever, in a conforming C++ program passing a reference is always bound to an object. If a pointer is passed, however, the function must be prepared to accept a NULL pointer. Also see [INT#022].



Literature References:
ISC++ Rec. 7.5