53 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// <random>10 11// template<class Engine, size_t k>12// class shuffle_order_engine13// {14// public:15// // types16// typedef typename Engine::result_type result_type;17//18// // engine characteristics19// static constexpr size_t table_size = k;20// static constexpr result_type min() { return Engine::min; }21// static constexpr result_type max() { return Engine::max; }22 23#include <random>24#include <type_traits>25#include <cassert>26 27#include "test_macros.h"28 29template <class T>30void where(const T &) {}31 32void33test1()34{35 typedef std::knuth_b E;36 static_assert(E::table_size == 256, "");37#if TEST_STD_VER >= 1138 static_assert((E::min() == 1), "");39 static_assert((E::max() == 2147483646), "");40#else41 assert((E::min() == 1));42 assert((E::max() == 2147483646));43#endif44 where(E::table_size);45}46 47int main(int, char**)48{49 test1();50 51 return 0;52}53