param_ctor_default.pass.cpp (786B)
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 // UNSUPPORTED: c++98, c++03 11 12 // <random> 13 14 // template<class IntType = int> 15 // class discrete_distribution 16 17 // param_type(initializer_list<double> wl); 18 19 #include <random> 20 #include <cassert> 21 22 int main() 23 { 24 { 25 typedef std::discrete_distribution<> D; 26 typedef D::param_type P; 27 P pa = {1}; 28 std::vector<double> p = pa.probabilities(); 29 assert(p.size() == 1); 30 assert(p[0] == 1); 31 } 32 }