[rand.dist.samp.pconst] plus some bug fixes in the tests of the other distributions

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@104224 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Howard Hinnant
2010-05-20 15:11:46 +00:00
parent 551d8e4ddb
commit d6d1171f2c
56 changed files with 2593 additions and 393 deletions

View File

@@ -0,0 +1,32 @@
//===----------------------------------------------------------------------===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
// <random>
// template<class RealType = double>
// class piecewise_constant_distribution
// void param(const param_type& parm);
#include <random>
#include <cassert>
int main()
{
{
typedef std::piecewise_constant_distribution<> D;
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
P pa(b, b+4, p);
D d;
d.param(pa);
assert(d.param() == pa);
}
}