diff --git a/test/algorithm_test/partition.cpp b/test/algorithm_test/partition.cpp index fe136e0..b91f244 100644 --- a/test/algorithm_test/partition.cpp +++ b/test/algorithm_test/partition.cpp @@ -42,19 +42,19 @@ namespace boost test_iter(Container& cont) { typedef BOOST_DEDUCED_TYPENAME range_iterator::type iter_t; - + const Container old_cont(cont); Container cont2(old_cont); iter_t result = boost::partition(cont, UnaryPredicate()); - + iter_t temp_result = boost::partition(cont2, UnaryPredicate()); cont2 = old_cont; BOOST_CHECK( temp_result == boost::partition( boost::make_iterator_range(cont2), UnaryPredicate()) ); - + BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(), cont2.begin(), cont2.end() ); - + return result; } @@ -68,20 +68,19 @@ namespace boost operator()(Policy& policy, Container& cont) { typedef BOOST_DEDUCED_TYPENAME range_return::type result_t; - + const Container old_cont(cont); Container cont2(old_cont); result_t result = boost::partition(cont, policy.pred()); - - result_t temp_result = boost::partition( - cont2, policy.pred()); - cont2 = old_cont; - BOOST_CHECK( temp_result == boost::partition( - boost::make_iterator_range(cont2), policy.pred()) ); - + + // Test that operation a temporary created by using + // make_iterator_range. + boost::partition( + boost::make_iterator_range(cont2), policy.pred()); + BOOST_CHECK_EQUAL_COLLECTIONS( cont.begin(), cont.end(), cont2.begin(), cont2.end() ); - + return result; } };