xref: /llvm-project/libcxx/test/std/numerics/rand/rand.util/rand.util.seedseq/initializer_list.pass.cpp (revision 31cbe0f240f660f15602c96b787c58a26f17e179)
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 // UNSUPPORTED: c++03
10 
11 // <random>
12 
13 // class seed_seq;
14 
15 // template<class T>
16 //     seed_seq(initializer_list<T> il);
17 
18 #include <random>
19 #include <cassert>
20 
21 #include "test_macros.h"
22 
main(int,char **)23 int main(int, char**)
24 {
25     std::seed_seq s= {5, 4, 3, 2, 1};
26     assert(s.size() == 5);
27     unsigned b[5] = {0};
28     s.param(b);
29     assert(b[0] == 5);
30     assert(b[1] == 4);
31     assert(b[2] == 3);
32     assert(b[3] == 2);
33     assert(b[4] == 1);
34 
35   return 0;
36 }
37