what is the purpose of using 'const int &' as formal argument?

Apr 30, 2009 at 11:09am
thx
Apr 30, 2009 at 11:49am
const int & doesn't make much sense but const Aclass & is used in order not to copy an object of 'Aclass' which can take much longer time than passing a const reference
Apr 30, 2009 at 5:33pm
Addition:
const can be used by compiler to optimize you code.
May 1, 2009 at 7:04pm
Passing an int by reference and promising not to modify it is a strange operation indeed.
Topic archived. No new replies allowed.