"cppsks" <sk*****@hotmail.com> wrote in message
news:cg**********@news.lsil.com...
What would be the rational for using const with standard types?
const int & OR const unsigned long &
It can happen as part of implicit tempalte instantiation.
template <class T>
void print(const T&);
For an explicit function, I'd probably pass by value as in the release build
it would probably be faster because the compiler could optimize without
having to worry about aliasing. See Victor's post too.
If you have a function and it receives a variable by value, but in the
function definition you declare the value const, that's another story. Is
this what you're asking about?
void f(int);
void f(const int i) {
...
}