| Common mathematical functions | |||||||||||||||||||||||||||||||
| Mathematical special functions(C++17) | |||||||||||||||||||||||||||||||
| Mathematical constants(C++20) | |||||||||||||||||||||||||||||||
| Basic linear algebra algorithms(C++26) | |||||||||||||||||||||||||||||||
| Data-parallel types (SIMD)(C++26) | |||||||||||||||||||||||||||||||
| Floating-point environment(C++11) | |||||||||||||||||||||||||||||||
| Complex numbers | |||||||||||||||||||||||||||||||
Numeric array (valarray) | |||||||||||||||||||||||||||||||
| Pseudo-random number generation | |||||||||||||||||||||||||||||||
| Bit manipulation(C++20) | |||||||||||||||||||||||||||||||
| Saturation arithmetic(C++26) | |||||||||||||||||||||||||||||||
| Factor operations | |||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||
| Interpolations | |||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||
| Generic numeric operations | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
| C-style checked integer arithmetic | |||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Member functions | ||||
seed_seq::seed_seq | ||||
seed_seq()noexcept; | (1) | (since C++11) |
seed_seq(const seed_seq&)= delete; | (2) | (since C++11) |
template<class InputIt> seed_seq( InputIt begin, InputIt end); | (3) | (since C++11) |
template<class T> seed_seq(std::initializer_list<T> il); | (4) | (since C++11) |
v is empty.std::seed_seq is not copyable.std::seed_seq with the values in the range[begin, end). Equivalent to default-initializingv followed byfor(InputIt s= begin; s!= end;++s) v .push_back(modseed(*s));, where\(\scriptsize \mathrm{modseed}(x)=x \mod 2^{32} \)mod_seed(x)=x mod 232InputIt does not satisfy the requirements ofLegacyInputIterator, the behavior is undefined.T is an integer type.| begin, end | - | the pair of iterators denoting the initial seed sequence |
| il | - | the initial seed sequence |
#include <iterator>#include <random>#include <sstream> int main(){std::seed_seq s1;// default-constructiblestd::seed_seq s2{1,2,3};// can use list-initializationstd::seed_seq s3={-1,0,1};// another form of list-initializationint a[10]={1,2,3,4,5,6,7,8,9,10};std::seed_seq s4(a, a+10);// can use iteratorsstd::istringstream buf("1 2 3 4 5");std::istream_iterator<int> beg(buf), end;std::seed_seq s5(beg, end);// even stream input iterators}
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 2180 | C++11 | all constructors were non-throwing | only overload(1) is non-throwing |
| LWG 3422 | C++11 | 1. overload(1) was not noexcept 2. overload(4) was not constrainted | 1.made noexcept 2. constrained |