Feature #694
Can uniform::generate() be const?
Status: | Rejected | Start date: | 11/01/2011 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | M. Rolf | % Done: | 0% | |
Category: | - | |||
Target version: | - |
Description
Can uniform::generate() be const?
History
#1 Updated by M. Rolf over 12 years ago
hm... semantically: not really, at least not as part of the Generator interface.
Think of a Generator that creates successive integers 1,2,3...
This one has a semantic state, which I explicitely intended to be possible when I wrote the interface. Actually I thought about kicking the const attributes is Mapping(Definition) as well, in order to allow Input/Output behaviors with state (e.g. RNNs).
Is there a particular use case where it matters?
#2 Updated by Anonymous over 12 years ago
- Status changed from New to Rejected
If you think of the random number generation as generating real random numbers, not the - actual - pseudo random numbers, the generate method could indeed be const. But this is a special and rare case. In general the generate() method changes the state of the generator, so it shouldn`t be const.