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 _IntType = int> 13 // class uniform_int_distribution 14 15 // explicit uniform_int_distribution(IntType a = 0, 16 // IntType b = numeric_limits<IntType>::max()); 17 18 #include <random> 19 #include <cassert> 20 main()21int main() 22 { 23 { 24 typedef std::uniform_int_distribution<> D; 25 D d; 26 assert(d.a() == 0); 27 assert(d.b() == std::numeric_limits<int>::max()); 28 } 29 { 30 typedef std::uniform_int_distribution<> D; 31 D d(-6); 32 assert(d.a() == -6); 33 assert(d.b() == std::numeric_limits<int>::max()); 34 } 35 { 36 typedef std::uniform_int_distribution<> D; 37 D d(-6, 106); 38 assert(d.a() == -6); 39 assert(d.b() == 106); 40 } 41 } 42