[rand.eng.general]

# 29 Numerics library [[numerics]](./#numerics)

## 29.5 Random number generation [[rand]](rand#eng.general)

### 29.5.4 Random number engine class templates [[rand.eng]](rand.eng#general)

#### 29.5.4.1 General [rand.eng.general]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L2595)

Each type instantiated
from a class template specified in [[rand.eng]](rand.eng "29.5.4 Random number engine class templates") meets the requirements
of a [random number engine](rand.req.eng "29.5.3.4 Random number engine requirements [rand.req.eng]") type[.](#1.sentence-1)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L2601)

Except where specified otherwise,
the complexity of each function
specified in [[rand.eng]](rand.eng "29.5.4 Random number engine class templates") is constant[.](#2.sentence-1)

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L2607)

Except where specified otherwise,
no function described in [[rand.eng]](rand.eng "29.5.4 Random number engine class templates") throws an exception[.](#3.sentence-1)

[4](#4)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L2612)

Every function described in [[rand.eng]](rand.eng "29.5.4 Random number engine class templates") that has a function parameter q of type Sseq& for a template type parameter named Sseq that is different from type seed_seq throws what and when the invocation of q.generate throws[.](#4.sentence-1)

[5](#5)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L2619)

Descriptions are provided in [[rand.eng]](rand.eng "29.5.4 Random number engine class templates") only for engine operations
that are not described in [[rand.req.eng]](rand.req.eng "29.5.3.4 Random number engine requirements") or for operations where there is additional semantic information[.](#5.sentence-1)

In particular,
declarations for copy constructors,
for copy assignment operators,
for streaming operators,
and for equality and inequality operators
are not shown in the synopses[.](#5.sentence-2)

[6](#6)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L2631)

Each template specified in [[rand.eng]](rand.eng "29.5.4 Random number engine class templates") requires one or more relationships,
involving the value(s) of its constant template parameter(s), to hold[.](#6.sentence-1)

A program instantiating any of these templates
is ill-formed
if any such required relationship fails to hold[.](#6.sentence-2)

[7](#7)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/numerics.tex#L2639)

For every random number engine and for every random number engine adaptor X defined in [[rand.eng]](rand.eng "29.5.4 Random number engine class templates") and in [[rand.adapt]](rand.adapt "29.5.5 Random number engine adaptor class templates"):

- [(7.1)](#7.1)

if the constructortemplate<class Sseq> explicit X(Sseq& q); is called with a type Sseq that does not qualify as a seed sequence, then this
constructor shall not participate in overload resolution;

- [(7.2)](#7.2)

if the member functiontemplate<class Sseq> void seed(Sseq& q); is called with a type Sseq that does not qualify as a seed sequence, then this
function shall not participate in overload resolution[.](#7.sentence-1)

The extent to which an implementation determines that a type cannot be a seed sequence
is unspecified, except that as a minimum a type shall not qualify as a seed sequence
if it is implicitly convertible to X​::​result_type[.](#7.sentence-2)
