1 //===----------------------------------------------------------------------===//
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
7 //===----------------------------------------------------------------------===//
11 // template<class Engine, size_t k>
12 // class shuffle_order_engine
14 // result_type operator()();
19 #include "test_macros.h"
21 template <class UIntType
, UIntType Min
, UIntType Max
>
26 typedef UIntType result_type
;
31 static_assert(Min
< Max
, "rand1 invalid parameters");
34 #if TEST_STD_VER < 11 && defined(_LIBCPP_VERSION)
35 // Workaround for lack of constexpr in C++03
36 static const result_type _Min
= Min
;
37 static const result_type _Max
= Max
;
40 static TEST_CONSTEXPR result_type
min() {return Min
;}
41 static TEST_CONSTEXPR result_type
max() {return Max
;}
43 explicit rand1(result_type sd
= Min
) : x_(sd
)
49 result_type
operator()()
63 typedef std::knuth_b E
;
66 assert(e() == 152607844u);
72 typedef rand1
<unsigned long long, 0, 0xFFFFFFFFFFFFFFFFull
> E0
;
73 typedef std::shuffle_order_engine
<E0
, 101> E
;
82 typedef rand1
<unsigned long long, 0, 0xFFFFFFFFFFFFFFFFull
> E0
;
83 typedef std::shuffle_order_engine
<E0
, 100> E
;