diff --git a/include/boost/algorithm/cxx11/partition_point.hpp b/include/boost/algorithm/cxx11/partition_point.hpp index 36d8384..9f0b972 100644 --- a/include/boost/algorithm/cxx11/partition_point.hpp +++ b/include/boost/algorithm/cxx11/partition_point.hpp @@ -61,7 +61,7 @@ ForwardIterator partition_point ( ForwardIterator first, ForwardIterator last, P /// \param p The predicate to test the values with /// template -typename boost::range_iterator partition_point ( Range &r, Predicate p ) +typename boost::range_iterator::type partition_point ( Range &r, Predicate p ) { return boost::algorithm::partition_point (boost::begin(r), boost::end(r), p); } diff --git a/test/partition_point_test1.cpp b/test/partition_point_test1.cpp index 95f6058..3d66770 100644 --- a/test/partition_point_test1.cpp +++ b/test/partition_point_test1.cpp @@ -54,6 +54,13 @@ void test_sequence ( Container &v, Predicate comp, int expected ) { std::cout << "Expected(2): " << std::distance ( v.begin (), exp ) << ", got: " << std::distance ( v.begin (), res ) << std::endl; BOOST_CHECK ( exp == res ); + +// Range based test + res = ba::partition_point ( v, comp ); + exp = offset_to_iter ( v, expected ); + std::cout << "Expected(3): " << std::distance ( v.begin (), exp ) + << ", got: " << std::distance ( v.begin (), res ) << std::endl; + BOOST_CHECK ( exp == res ); } template