This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of Resolved status.
Section: 25.6.7.1 [rand.util.seedseq] Status: Resolved Submitter: Stephan Tolksdorf Opened: 2008-02-18 Last modified: 2019-01-01
Priority: Not Prioritized
View all other issues in [rand.util.seedseq].
View all issues with Resolved status.
Discussion:
The for-loop in the algorithm specification has n iterations, where n is defined to be end - begin, i.e. the number of supplied w-bit quantities. Previous versions of this algorithm and the general logic behind it suggest that this is an oversight and that in the context of the for-loop n should be the number of full 32-bit quantities in b (rounded upwards). If w is 64, the current algorithm throws away half of all bits in b. If w is 16, the current algorithm sets half of all elements in v to 0.
There are two more minor issues:
[ Bellevue: ]
Move to Open: Bill will try to propose a resolution by the next meeting.
[ post Bellevue: Bill provided wording. ]
This issue is made moot if 803 is accepted.
Proposed resolution:
Replace 25.6.7.1 [rand.util.seedseq] paragraph 6 with:
Effects: Constructs a seed_seq object by effectively concatenating the low-order u bits of each of the elements of the supplied sequence [begin, end) in ascending order of significance to make a (possibly very large) unsigned binary number b having a total of n bits, and then carrying out the following algorithm:
for( v.clear(); n > 0; n -= 32 ) v.push_back(b mod 2^{32}), b /= 2^{32};
Rationale:
Addressed by N2836 "Wording Tweaks for Concept-enabled Random Number Generation in C++0X".