The C ++ standard does NOT guarantee that std :: generate assigns elements in sequential order, but this severely limits its usefulness. In this case, I can only think of two possible use cases:
A functor that returns a constant value. But you can just use std :: fill.
Filling the data structure with arbitrary or arbitrary values ββnot guaranteed by reproducibility from the same seed.
Also, what are some non-trivial uses of std :: generate that conform to the C ++ standard?
source
share