[gn build] Port f3c4b58f4b0d
[llvm-project.git] / libcxx / test / std / numerics / rand / rand.adapt / rand.adapt.shuf / seed_sseq.pass.cpp
blob615f58b77450c0e844c97f9934fcf545d6124493
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 //===----------------------------------------------------------------------===//
9 // <random>
11 // template<class Engine, size_t k>
12 // class shuffle_order_engine
14 // template<class Sseq> void seed(Sseq& q);
16 #include <random>
17 #include <cassert>
19 #include "test_macros.h"
21 void
22 test1()
24 unsigned a[] = {3, 5, 7};
25 std::seed_seq sseq(a, a+3);
26 std::knuth_b e1;
27 std::knuth_b e2(sseq);
28 assert(e1 != e2);
29 e1.seed(sseq);
30 assert(e1 == e2);
33 int main(int, char**)
35 test1();
37 return 0;