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 template <class _Tp> where(const _Tp &)29void where(const _Tp &) {} 30 31 void test1()32test1() 33 { 34 typedef std::knuth_b E; 35 static_assert(E::table_size == 256, ""); 36 #if TEST_STD_VER >= 11 37 static_assert((E::min() == 1), ""); 38 static_assert((E::max() == 2147483646), ""); 39 #else 40 assert((E::min() == 1)); 41 assert((E::max() == 2147483646)); 42 #endif 43 where(E::table_size); 44 } 45 main()46int main() 47 { 48 test1(); 49 } 50