|
Boost : |
From: Gennadiy Rozental (rogeeff_at_[hidden])
Date: 2008-01-17 14:35:40
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
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk