Debian Codegraph @

libcxx/test/std/numerics/rand/rand.dist/rand.dist.samp/rand.dist.samp.discrete/assign.pass.cpp

raw
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 // <random>
10
11 // template<class IntType = int>
12 // class discrete_distribution
13
14 // discrete_distribution& operator=(const discrete_distribution&);
15
16 #include <random>
17 #include <cassert>
18
19 #include "test_macros.h"
20
21 void
22 test1()
23 {
24 typedef std::discrete_distribution<> D;
25 double p[] = {2, 4, 1, 8};
26 D d1(p, p+4);
27 D d2;
28 assert(d1 != d2);
29 d2 = d1;
30 assert(d1 == d2);
31 }
32
33 int main(int, char**)
34 {
35 test1();
36
37 return 0;
38 }