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 Engine, size_t p, size_t r> 12 // class discard_block_engine 13 14 // discard_block_engine& operator=(const discard_block_engine&); 15 16 #include <random> 17 #include <cassert> 18 19 void 20 test1() 21 { 22 typedef std::ranlux24 E; 23 E e1(2); 24 (void)e1(); 25 E e2(5); 26 e2 = e1; 27 assert(e1 == e2); 28 assert(e1() == e2()); 29 E::result_type k = e1(); 30 assert(e1 != e2); 31 assert(e2() == k); 32 assert(e1 == e2); 33 } 34 35 void 36 test2() 37 { 38 typedef std::ranlux48 E; 39 E e1(3); 40 (void)e1(); 41 E e2(5); 42 e2 = e1; 43 assert(e1 == e2); 44 assert(e1() == e2()); 45 E::result_type k = e1(); 46 assert(e1 != e2); 47 assert(e2() == k); 48 assert(e1 == e2); 49 } 50 51 int main(int, char**) 52 { 53 test1(); 54 test2(); 55 56 return 0; 57 } 58