1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef BOOST_ALGORITHM_HPP
- #define BOOST_ALGORITHM_HPP
- #include <algorithm>
- #include <vector>
- #include <boost/range/begin.hpp>
- #include <boost/range/end.hpp>
- #include <boost/range/algorithm/copy.hpp>
- #include <boost/range/algorithm/equal.hpp>
- #include <boost/range/algorithm/sort.hpp>
- #include <boost/range/algorithm/stable_sort.hpp>
- #include <boost/range/algorithm/find_if.hpp>
- #include <boost/range/algorithm/count.hpp>
- #include <boost/range/algorithm/count_if.hpp>
- #include <boost/range/algorithm_ext/is_sorted.hpp>
- #include <boost/range/algorithm_ext/iota.hpp>
- namespace boost
- {
- template < typename InputIterator, typename Predicate >
- bool any_if(InputIterator first, InputIterator last, Predicate p)
- {
- return std::find_if(first, last, p) != last;
- }
- template < typename Container, typename Predicate >
- bool any_if(const Container& c, Predicate p)
- {
- return any_if(boost::begin(c), boost::end(c), p);
- }
- template < typename InputIterator, typename T >
- bool container_contains(InputIterator first, InputIterator last, T value)
- {
- return std::find(first, last, value) != last;
- }
- template < typename Container, typename T >
- bool container_contains(const Container& c, const T& value)
- {
- return container_contains(boost::begin(c), boost::end(c), value);
- }
- }
- #endif
|