#157388 - keldon - Fri May 23, 2008 9:19 am
Code: |
const MyClass& obj = MyClass (1,2,3);
int m = obj.get_product() + obj.get_sum(); |
Not that I'm using this; but with optimisations and all, what is the worst that could/should happen? Apparently a const reference will extend the lifetime of the reference object to the lifetime of the const reference. I'm not too sure about that though and wanted some clarification on what the standards say.