27-05-2011, 10:24 AM
Hello,
Is rule 7-5-3 really relevant?
It says that something like
is not compliant.
But surely all C++ developers on the planet would expect x to be modified here after calling f:
So why returning x directly would be an issue? I guess there is probably something I am not seeing here!
Thanks for any clarification!
Fabrice
Is rule 7-5-3 really relevant?
It says that something like
Code:
int& f(int& x)
{
return x;
}
But surely all C++ developers on the planet would expect x to be modified here after calling f:
Code:
void f(int& x)
{
x++;
}
So why returning x directly would be an issue? I guess there is probably something I am not seeing here!
Thanks for any clarification!
Fabrice
<t></t>