Boost logo

Boost :

From: Matthias Troyer (troyer_at_[hidden])
Date: 2003-04-16 06:44:29


On Tuesday, April 15, 2003, at 05:39 PM, Thorsten Ottosen wrote:
>>
> yep, you're all right.
>
> but...I still need to ask
>
> 2) After all, a client don't care what random number he gets, only
> that he
> gets one. The right result of a call to rand() is not that it is a
> particular random number, but that it's a random number. If the order
> of the
> sequence is important, that is still achievable if operator() is
> const, it
> is just not enforced by the compiler.

Here I disagree. I actually do care very much about what number I get.
There are several application where it is of essential importance to
get the identical sequence again. I thus want to have control over
where the internal state of the generator is changed - and that's where
const comes in.

> 3) so (as seen from the client in 99% of the time) what is really the
> benefit of having a non-const operator() .?

et me ask differently: what is the benefit of making it const?

Matthias


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk