I am trying to learn the new C++0x approach to random number generators (26.5), and implement at C++0x-compliant random number engine (26.5.1.4).
The standard goes into detail on the required interface for seed sequences, and how they can be passed to the constructor or seed functions of engines.
However, I cannot find any standard interface to create or generate a seed sequence from an engine, thereby getting its internal state. Is there one? Or can states only be copied between engines via copy-construction/assignment or copying the initial seed sequence?
If it’s not possible, does anyone know what the rationale is (if any) for not providing such an interface?
There is no API for generating a seed or seed sequence from an engine’s state. However the engine’s state can be streamed into an istream, and extracted from an ostream. And the engine’s state is EqualityComparable to another engine’s state (for same-type engines).
One might inspect the istream generated by streaming an engine to it. However the format of that istream is unspecified.