From 732e2681c710147e95b390db06bf72ded13efb1e Mon Sep 17 00:00:00 2001 From: Evgeniy Stepanov Date: Wed, 13 May 2015 16:55:41 +0000 Subject: Implement std::experimental::sample. Following specification in "C++ Extensions for Library Fundamentals": http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html#alg.random.sample llvm-svn: 237264 --- .../algorithms/alg.random.sample/sample.fail.cpp | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 libcxx/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp (limited to 'libcxx/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp') diff --git a/libcxx/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp b/libcxx/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp new file mode 100644 index 00000000000..eeb43737932 --- /dev/null +++ b/libcxx/test/std/experimental/algorithms/alg.random.sample/sample.fail.cpp @@ -0,0 +1,36 @@ +//===----------------------------------------------------------------------===// +// +// 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 +// SampleIterator sample(PopulationIterator first, PopulationIterator last, +// SampleIterator out, Distance n, +// UniformRandomNumberGenerator &&g); + +#include +#include +#include + +#include "test_iterators.h" + +template void test() { + int ia[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + const unsigned is = sizeof(ia) / sizeof(ia[0]); + const unsigned os = 4; + int oa[os]; + std::minstd_rand g; + std::experimental::sample(PopulationIterator(ia), PopulationIterator(ia + is), + SampleIterator(oa), os, g); +} + +int main() { + test, output_iterator >(); +} -- cgit v1.2.3