Fix test for default constructor of discrete_distribution. This partially addresses http://llvm.org/bugs/show_bug.cgi?id=12436.
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@153873 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
27b4fd30ef
commit
2cf89a71df
@ -12,21 +12,18 @@
|
|||||||
// template<class IntType = int>
|
// template<class IntType = int>
|
||||||
// class discrete_distribution
|
// class discrete_distribution
|
||||||
|
|
||||||
// discrete_distribution(initializer_list<double> wl);
|
// discrete_distribution();
|
||||||
|
|
||||||
#include <random>
|
#include <random>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
{
|
{
|
||||||
typedef std::discrete_distribution<> D;
|
typedef std::discrete_distribution<> D;
|
||||||
D d = {1., 2.};
|
D d;
|
||||||
std::vector<double> p = d.probabilities();
|
std::vector<double> p = d.probabilities();
|
||||||
assert(p.size() == 2);
|
assert(p.size() == 1);
|
||||||
assert(p[0] == 1);
|
assert(p[0] == 1);
|
||||||
assert(p[1] == 2);
|
|
||||||
}
|
}
|
||||||
#endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user