509. Uniform_int template parameters

Section: [rand.dist.uni], 99 [tr.rand.dist.iunif] Status: NAD Submitter: Walter Brown Opened: 2005-07-03 Last modified: 2016-01-28 10:19:27 UTC

Priority: Not Prioritized

View all other issues in [rand.dist.uni].

View all issues with NAD status.


In [tr.rand.dist.iunif] the uniform_int distribution currently has a single template parameter, IntType, used as the input_type and as the result_type of the distribution. We believe there is no reason to conflate these types in this way.

Proposed resolution:

We recommend that there be a second template parameter to reflect the distribution's input_type, and that the existing first template parameter continue to reflect (solely) the result_type:

template< class IntType = int, UIntType = unsigned int >
class uniform_int
  // types
  typedef  UIntType  input_type;
  typedef  IntType   result_type;

[ Berlin: Moved to NAD. N1932 makes this moot: the input_type template parameter has been eliminated. ]