29 Numerics library [numerics]

29.5 Random number generation [rand]

29.5.3 Requirements [rand.req]

29.5.3.1 General requirements [rand.req.genl]

Throughout [rand], where the template parameters are not constrained, the names of template parameters are used to express type requirements on an instantiated template T:
  • If T has a template type parameter named Sseq, URBG, Engine, RealType, IntType, or UIntType, the program is ill-formed if the corresponding template argument is cv-qualified.
  • A template argument corresponding to a template parameter named Sseq shall meet the requirements of seed sequence.
  • A template argument corresponding to a template parameter named URBG shall meet the requirements of uniform random bit generator.
  • A template argument corresponding to a template parameter named Engine shall meet the requirements of random number engine.
  • If a template argument corresponding to a template parameter named RealType is neither a standard floating-point type ([basic.fundamental]) nor a member of an implementation-defined subset of extended floating-point types, the program is ill-formed.
  • If a template argument corresponding to a template parameter named IntType is neither a standard signed nor a standard unsigned integer type ([basic.fundamental]), nor an extended integer type whose width is greater or equal to that of char and less than or equal to that of long long, nor a member of an implementation-defined subset of integer types, the program is ill-formed.
  • If a template argument corresponding to a template parameter named UIntType is neither a standard or extended unsigned integer type whose width is greater or equal to that of short and less than or equal to that of long long, nor a member of an implementation-defined subset of unsigned integer types, the program is ill-formed.
Throughout [rand], phrases of the form “x is an iterator of a specific kind” shall be interpreted as equivalent to the more formal requirement that “x is a value of a type meeting the requirements of the specified iterator type”.
Throughout [rand], any constructor that can be called with a single argument and that meets a requirement specified in this subclause shall be declared explicit.