Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-04-16 11:29:04

Matthias Troyer <troyer_at_[hidden]> writes:
> I never not needed mutable yet in any code of mine using random number
> generators. Could you give an example that shows where it is needed?

It's never needed because you can always pass the generator through
an adaptor:

    template <class F, class T = F::result_type>
    struct nullary_const_function
        nullary_const_function(F& f) : f(f) {}
        T operator() const { return f(); }
        F& f;

(or something).

It's just a matter of convenience.

Dave Abrahams
Boost Consulting

Boost list run by bdawes at, gregod at, cpdaniel at, john at