//===----------------------------------------------------------------------===// // // The LLVM Compiler Infrastructure // // This file is dual licensed under the MIT and the University of Illinois Open // Source Licenses. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // template // class linear_congruential_engine // { // public: // engine characteristics // static constexpr result_type multiplier = a; // static constexpr result_type increment = c; // static constexpr result_type modulus = m; // static constexpr result_type min() { return c == 0u ? 1u: 0u;} // static constexpr result_type max() { return m - 1u;} // static constexpr result_type default_seed = 1u; #include #include #include template void test1() { typedef std::linear_congruential_engine LCE; typedef typename LCE::result_type result_type; static_assert((LCE::multiplier == a), ""); static_assert((LCE::increment == c), ""); static_assert((LCE::modulus == m), ""); /*static_*/assert((LCE::min() == (c == 0u ? 1u: 0u))/*, ""*/); /*static_*/assert((LCE::max() == result_type(m - 1u))/*, ""*/); static_assert((LCE::default_seed == 1), ""); } template void test() { test1(); test1(); test1(); const T M(~0); test1(); test1(); test1(); test1(); test1(); test1(); test1(); test1(); test1(); } int main() { test(); test(); test(); test(); }