12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- #ifndef BOOST_ALGORITHM_IS_PARTITIONED_UNTIL_HPP
- #define BOOST_ALGORITHM_IS_PARTITIONED_UNTIL_HPP
- #include <boost/config.hpp>
- #include <boost/range/begin.hpp>
- #include <boost/range/end.hpp>
- namespace boost { namespace algorithm {
- template <typename InputIterator, typename UnaryPredicate>
- InputIterator is_partitioned_until ( InputIterator first, InputIterator last, UnaryPredicate p )
- {
- for ( ; first != last; ++first )
- if ( !p (*first))
- break;
- for ( ; first != last; ++first )
- if ( p (*first))
- return first;
- return last;
- }
- template <typename Range, typename UnaryPredicate>
- typename boost::range_iterator<const Range>::type is_partitioned_until ( const Range &r, UnaryPredicate p )
- {
- return boost::algorithm::is_partitioned_until (boost::begin(r), boost::end(r), p);
- }
- }}
- #endif
|