Commit 17739146 by Jonathan Wakely Committed by Jonathan Wakely

Resolve ambiguities in std::experimental::sample test

	* testsuite/experimental/algorithm/sample.cc: Qualify calls to
	resolve ambiguity between std::sample and std::experimental::sample.

From-SVN: r241183
parent 9a822fc7
2016-10-14 Jonathan Wakely <jwakely@redhat.com> 2016-10-14 Jonathan Wakely <jwakely@redhat.com>
* testsuite/experimental/algorithm/sample.cc: Qualify calls to
resolve ambiguity between std::sample and std::experimental::sample.
* include/std/functional (_Mu<A, false, true>, _Mu<A, true, false>): * include/std/functional (_Mu<A, false, true>, _Mu<A, true, false>):
Simplify forwarding from tuple of references. Simplify forwarding from tuple of references.
(_Maybe_wrap_member_pointer): Remove. (_Maybe_wrap_member_pointer): Remove.
......
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
std::mt19937 rng; std::mt19937 rng;
using std::experimental::sample;
using std::istream_iterator; using std::istream_iterator;
using std::ostream_iterator; using std::ostream_iterator;
...@@ -39,7 +38,7 @@ test01() ...@@ -39,7 +38,7 @@ test01()
int samp[10] = { }; int samp[10] = { };
// population smaller than desired sample size // population smaller than desired sample size
auto it = sample(pop, pop + 2, samp, 10, rng); auto it = std::experimental::sample(pop, pop + 2, samp, 10, rng);
VERIFY( it == samp + 2 ); VERIFY( it == samp + 2 );
VERIFY( std::accumulate(samp, samp + 10, 0) == 3 ); VERIFY( std::accumulate(samp, samp + 10, 0) == 3 );
} }
...@@ -50,7 +49,7 @@ test02() ...@@ -50,7 +49,7 @@ test02()
const int pop[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }; const int pop[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 };
int samp[10] = { }; int samp[10] = { };
auto it = sample(pop, std::end(pop), samp, 10, rng); auto it = std::experimental::sample(pop, std::end(pop), samp, 10, rng);
VERIFY( it == samp + 10 ); VERIFY( it == samp + 10 );
std::sort(samp, it); std::sort(samp, it);
...@@ -65,7 +64,9 @@ test03() ...@@ -65,7 +64,9 @@ test03()
int samp[5] = { }; int samp[5] = { };
// input iterator for population // input iterator for population
auto it = sample(istream_iterator<int>{pop}, {}, samp, 5, rng); auto it = std::experimental::sample(istream_iterator<int>{pop}, {},
samp,
5, rng);
VERIFY( it == samp + 5 ); VERIFY( it == samp + 5 );
std::sort(samp, it); std::sort(samp, it);
...@@ -80,7 +81,9 @@ test04() ...@@ -80,7 +81,9 @@ test04()
std::stringstream samp; std::stringstream samp;
// forward iterator for population and output iterator for result // forward iterator for population and output iterator for result
sample(pop.begin(), pop.end(), ostream_iterator<int>{samp, " "}, 5, rng); std::experimental::sample(pop.begin(), pop.end(),
ostream_iterator<int>{samp, " "},
5, rng);
// samp.rdbuf()->pubseekoff(0, std::ios::beg); // samp.rdbuf()->pubseekoff(0, std::ios::beg);
std::vector<int> v(istream_iterator<int>{samp}, {}); std::vector<int> v(istream_iterator<int>{samp}, {});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment