S
Subhransu
Hi All,
I read in one of the links that,
- Returning by const reference exposes the internal data structure (I
understood it to some extent that the returned reference could be
assumed to be a member variable as it has to live even after the
called function returns)
- It makes the API vulnerable for BC (Binary Compatibility) break!
Can someone please explain how? Also, I had a notion that it is better
to return by const reference as it will have some performance edge.
Regards,
Subhransu
I read in one of the links that,
- Returning by const reference exposes the internal data structure (I
understood it to some extent that the returned reference could be
assumed to be a member variable as it has to live even after the
called function returns)
- It makes the API vulnerable for BC (Binary Compatibility) break!
Can someone please explain how? Also, I had a notion that it is better
to return by const reference as it will have some performance edge.
Regards,
Subhransu