What are some non-trivial uses of std :: generate?

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?

+4
source share

No one has answered this question yet.

See similar questions:

:

3076
++?
2387
?
1994
?
1911
?
1717
?
1564
?

Source: https://habr.com/ru/post/1545516/


All Articles