Created on 2007-09-21.00:00:00 last changed 172 months ago
[ Stephan Tolksdorf adds pre-Bellevue: ]
In [rand.dist.samp.pconst]:
Proposed wording a)
Change in para. 2
Constructs a piecewise_constant_distribution object with n = 1, p0 = w0 = 1, b0 = 0, and b1 = 1
and change in para. 5
A vector<result_type> whose size member returns n and whose operator[] member returns
pkthe weight wk as a double value when invoked with argument k for k = 0, ..., n-1Proposed wording b)
Change both occurrences of
"piecewise_constant_distribution(InputIteratorB firstB, InputIteratorB lastB, InputIteratorW firstW, InputIteratorW lastW)and change in para. 3
the length of the sequence w starting from firstW shall be at least n, *firstW shall return a value w0 that is convertible to double, and any wk for k >= n shall be ignored by the distribution[firstW, lastW) shall form a sequence w of length n whose leading element w0 shall be convertible to double
Proposed resolution:
See N2424 for the proposed resolution.
[ Bellevue: ]
In N2424. There is already precedent elsewhere in the library. Follows existing convention. NAD.
The design of the constructor
template <class InputIteratorB, class InputIteratorW> piecewise_constant_distribution( InputIteratorB firstB, InputIteratorB lastB, InputIteratorW firstW);
is unnecessarily unsafe, as there is no separate end-iterator given for the weights. I can't see any performance or convenience reasons that would justify the risks inherent in such a function interface, in particular the risk that input error might go unnoticed.
Possible resolution: I propose to add an InputIteratorW lastW argument to the interface.
History | |||
---|---|---|---|
Date | User | Action | Args |
2010-10-21 18:28:33 | admin | set | messages: + msg3610 |
2010-10-21 18:28:33 | admin | set | messages: + msg3609 |
2010-10-21 18:28:33 | admin | set | messages: + msg3608 |
2010-10-21 18:28:33 | admin | set | messages: + msg3607 |
2007-09-21 00:00:00 | admin | create |