Home | History | Annotate | Download | only in rand.adapt.shuf
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // <random>
     11 
     12 // template<class Engine, size_t k>
     13 // class shuffle_order_engine
     14 // {
     15 // public:
     16 //     // types
     17 //     typedef typename Engine::result_type result_type;
     18 //
     19 //     // engine characteristics
     20 //     static constexpr size_t table_size = k;
     21 //     static constexpr result_type min() { return Engine::min; }
     22 //     static constexpr result_type max() { return Engine::max; }
     23 
     24 #include <random>
     25 #include <type_traits>
     26 #include <cassert>
     27 
     28 #include "test_macros.h"
     29 
     30 template <class _Tp>
     31 void where(const _Tp &) {}
     32 
     33 void
     34 test1()
     35 {
     36     typedef std::knuth_b E;
     37     static_assert(E::table_size == 256, "");
     38 #if TEST_STD_VER >= 11
     39     static_assert((E::min() == 1), "");
     40     static_assert((E::max() == 2147483646), "");
     41 #else
     42     assert((E::min() == 1));
     43     assert((E::max() == 2147483646));
     44 #endif
     45     where(E::table_size);
     46 }
     47 
     48 int main()
     49 {
     50     test1();
     51 }
     52