Title
Integer types in pseudo-random number engine requirements
Status
nad editorial
Section
[rand.req][tr.rand.req]
Submitter
Walter Brown

Created on 2005-07-03.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Rationale:

Jens: Just requiring X(unsigned long) still makes it possible for an evil library writer to also supply a X(int) that does something unexpected. The wording above requires that X(s) always performs as if X(unsigned long) would have been called. I believe that is sufficient and implements our intentions from Mont Tremblant. I see no additional use in actually requiring a X(unsigned long) signature. u.seed(s) is covered by its reference to X(s), same arguments.

Date: 2010-10-21.18:28:33

[ Berlin: N1932 adopts the proposed resolution: see 26.3.1.3/1e and Table 3 row 2. Moved to Ready. ]

Date: 2010-10-21.18:28:33

[ Mont Tremblant: Both s and g should be unsigned long. This should refer to the constructor signatures. Jens provided wording post Mont Tremblant. ]

Date: 2010-10-21.18:28:33

Proposed resolution:

In 5.1.1 [tr.rand.req], Paragraph 2 replace

... s is a value of integral type, g is an lvalue of a type other than X that defines a zero-argument function object returning values of unsigned integral type unsigned long int, ...

In 5.1.1 [tr.rand.seq], Table 16, replace in the line for X(s)

creates an engine with the initial internal state determined by static_cast<unsigned long>(s)

Date: 2005-07-03.00:00:00

In [tr.rand.req], Paragraph 2 states that "... s is a value of integral type, g is an ... object returning values of unsigned integral type ..."

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2873
2010-10-21 18:28:33adminsetmessages: + msg2872
2010-10-21 18:28:33adminsetmessages: + msg2871
2010-10-21 18:28:33adminsetmessages: + msg2870
2005-07-03 00:00:00admincreate