
17 Jan
2008
17 Jan
'08
7:35 p.m.
Giovanni Piero Deretta <gpderetta <at> gmail.com> writes:
How is a global free function is as bad as a global variable? You cannot mutate a function, while you can certainly mutate a variable.
It's really depends on type returned by yout global free function. It you need to invoke mutating operation it's going to be T&. And you can mutate all you want. If you don't need to mutate, you can have T const as a type of global variable and you can't mutate it either. Gennadiy