M
Marcin Vorbrodt
I understand that compiler may optimize better, if as parameters to my
functions i pass:
const Object &o
instead of
Object &o
All the implicit type conversion and all sounds good (Effective C++ rules).
But, does it make any difference if i do simillar thing for primitive types:
function(int x) vs function(const int x)
and i know that x will not be assigned to in the body of the function.
Is there any advantage at all in putting the const qualifier for primitives?
Thanks,
Martin
functions i pass:
const Object &o
instead of
Object &o
All the implicit type conversion and all sounds good (Effective C++ rules).
But, does it make any difference if i do simillar thing for primitive types:
function(int x) vs function(const int x)
and i know that x will not be assigned to in the body of the function.
Is there any advantage at all in putting the const qualifier for primitives?
Thanks,
Martin