1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- #ifndef BOOST_ALGORITHM_NONE_OF_HPP
- #define BOOST_ALGORITHM_NONE_OF_HPP
- #include <boost/config.hpp>
- #include <boost/range/begin.hpp>
- #include <boost/range/end.hpp>
- namespace boost { namespace algorithm {
- template<typename InputIterator, typename Predicate>
- BOOST_CXX14_CONSTEXPR bool none_of ( InputIterator first, InputIterator last, Predicate p )
- {
- for ( ; first != last; ++first )
- if ( p(*first))
- return false;
- return true;
- }
- template<typename Range, typename Predicate>
- BOOST_CXX14_CONSTEXPR bool none_of ( const Range &r, Predicate p )
- {
- return boost::algorithm::none_of (boost::begin (r), boost::end (r), p );
- }
- template<typename InputIterator, typename V>
- BOOST_CXX14_CONSTEXPR bool none_of_equal ( InputIterator first, InputIterator last, const V &val )
- {
- for ( ; first != last; ++first )
- if ( val == *first )
- return false;
- return true;
- }
- template<typename Range, typename V>
- BOOST_CXX14_CONSTEXPR bool none_of_equal ( const Range &r, const V & val )
- {
- return boost::algorithm::none_of_equal (boost::begin (r), boost::end (r), val);
- }
- }}
- #endif
|