| (1) | (since C++11) | ||
| (2) | (since C++11) | ||
| (3) | (since C++11) | ||
| (4) | (since C++11) |
1) The default constructor creates a
std::seed_seq
object with an initial seed sequence of length zero. 2) The copy constructor is deleted:
std::seed_seq
is not copyable. 3) Constructs a
(that is, the lower 32 bits are copied)
std::seed_seq
with the initial seed sequence obtained by iterating over the range [begin, end)
and copying the values obtained by dereferencing the iterator, modulo 232(that is, the lower 32 bits are copied)
Parameters
begin, end | - | the initial seed sequence represented as a pair of input iterators whose std::iterator_traits<>::value_type is an integer type |
il | - | std::initializer_list of objects of integer type, providing the iniial seed sequence |
Type requirements | ||
- InputIt must meet the requirements of InputIterator . |
Exceptions
1) Does not throw
Example
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #include <random> #include <sstream> #include <iterator> int main() { std::seed_seq s1; // default-constructible std::seed_seq s2{1, 2, 3}; // can use list-initialization std::seed_seq s3 = {-1, 0, 1}; // another form of list-initialization int a[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; std::seed_seq s4(a, a + 10); // can use iterators std::istringstream buf( "1 2 3 4 5" ); std::istream_iterator< int > beg(buf), end; std::seed_seq s5(beg, end); // even stream input iterators } |
Please login to continue.