[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

@ -33,10 +33,13 @@ namespace boost
boost::sort(test);
std::sort(reference.begin(), reference.end());
BOOST_CHECK_EQUAL_COLLECTIONS(
reference.begin(), reference.end(),
test.begin(), test.end()
);
BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
test.begin(), test.end() );
Container test2(cont);
boost::sort(boost::make_iterator_range(test2));
BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
test2.begin(), test2.end() );
}
template<class Container, class BinaryPredicate>
@ -52,6 +55,11 @@ namespace boost
reference.begin(), reference.end(),
test.begin(), test.end()
);
Container test2(cont);
boost::sort(boost::make_iterator_range(test2), pred);
BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
test2.begin(), test2.end() );
}
template<class Container>