[boost][range] - Improved handling of temporary ranges in range algorithms.

[SVN r63903]
This commit is contained in:
Neil Groves
2010-07-12 00:12:49 +00:00
parent ef000176d8
commit 74a01a4487
57 changed files with 1178 additions and 216 deletions

View File

@ -110,6 +110,14 @@ namespace boost
{
shuffled = true;
}
// Verify that the shuffle can be performed on a
// temporary range
Container test2(cont);
boost::random_shuffle(boost::make_iterator_range(test2));
ok = test_shuffle_result(cont, test2);
if (!ok)
break;
}
}
@ -124,6 +132,17 @@ namespace boost
{
BOOST_CHECK( gen.invocation_count() > 0 );
}
// Test that random shuffle works when
// passed a temporary range
RandomGenerator gen2;
Container cont2(old_cont);
boost::random_shuffle(boost::make_iterator_range(cont2), gen2);
test_shuffle_result(cont2, old_cont);
if (cont2.size() > 2)
{
BOOST_CHECK( gen2.invocation_count() > 0 );
}
}
template<class Container>