Because of this, functions which return no value should specify void as the return type. If a function returns a reference or a pointer to a local variable, the memory to which it refers will already have been deallocated, when this reference or pointer is used, The compiler may or may not give a warning for this. 39 Functions which return no value should be specified as having the return type void . 45 Use inline functions when they are really needed. See also 7.2.
Inline functions have the advantage of often being faster to execute than ordinary functions.
The disadvantage in their use is that the implementation becomes more exposed, since the definition of an inline function must be placed in an include file for the class, while the definition of an ordinary function may be placed in its own separate file. A result of this is that a change in the implementation of an inline function can require comprehensive re-compiling when the include file is changed. This is true for traditional file-based programming environments which use such mechanisms as make for compilation. The compiler is not compelled to actually make a function inline, The decision criteria for this differ from one compiler to another. It may be appropriate to separate inline definitions from class definitions and to place these in a separate file.