forked from boostorg/range
[boost][range] - Improved handling of temporary ranges in range algorithms.
[SVN r63903]
This commit is contained in:
@ -25,12 +25,12 @@ namespace boost
|
||||
{
|
||||
Container reference(cont);
|
||||
Container test(cont);
|
||||
Container test2(cont);
|
||||
|
||||
const bool reference_ret
|
||||
= std::prev_permutation(reference.begin(), reference.end());
|
||||
|
||||
const bool test_ret
|
||||
= boost::prev_permutation(test);
|
||||
const bool test_ret = boost::prev_permutation(test);
|
||||
|
||||
BOOST_CHECK( reference_ret == test_ret );
|
||||
|
||||
@ -38,6 +38,14 @@ namespace boost
|
||||
reference.begin(), reference.end(),
|
||||
test.begin(), test.end()
|
||||
);
|
||||
|
||||
BOOST_CHECK( test_ret == boost::prev_permutation(
|
||||
boost::make_iterator_range(test2)) );
|
||||
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||
reference.begin(), reference.end(),
|
||||
test2.begin(), test2.end()
|
||||
);
|
||||
}
|
||||
|
||||
template<class Container, class BinaryPredicate>
|
||||
@ -46,13 +54,13 @@ namespace boost
|
||||
{
|
||||
Container reference(cont);
|
||||
Container test(cont);
|
||||
Container test2(cont);
|
||||
|
||||
const bool reference_ret
|
||||
= std::prev_permutation(reference.begin(), reference.end(),
|
||||
pred);
|
||||
|
||||
const bool test_ret
|
||||
= boost::prev_permutation(test, pred);
|
||||
const bool test_ret = boost::prev_permutation(test, pred);
|
||||
|
||||
BOOST_CHECK( reference_ret == test_ret );
|
||||
|
||||
@ -60,6 +68,14 @@ namespace boost
|
||||
reference.begin(), reference.end(),
|
||||
test.begin(), test.end()
|
||||
);
|
||||
|
||||
BOOST_CHECK( test_ret == boost::prev_permutation(
|
||||
boost::make_iterator_range(test2), pred) );
|
||||
|
||||
BOOST_CHECK_EQUAL_COLLECTIONS(
|
||||
reference.begin(), reference.end(),
|
||||
test2.begin(), test2.end()
|
||||
);
|
||||
}
|
||||
|
||||
template<class Container>
|
||||
|
Reference in New Issue
Block a user