123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- #ifndef BOOST_ALGORITHM_MISMATCH_HPP
- #define BOOST_ALGORITHM_MISMATCH_HPP
- #include <utility>
- #include <boost/config.hpp>
- namespace boost { namespace algorithm {
- template <class InputIterator1, class InputIterator2, class BinaryPredicate>
- BOOST_CXX14_CONSTEXPR std::pair<InputIterator1, InputIterator2> mismatch (
- InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2,
- BinaryPredicate pred )
- {
- for (; first1 != last1 && first2 != last2; ++first1, ++first2)
- if ( !pred ( *first1, *first2 ))
- break;
- return std::pair<InputIterator1, InputIterator2>(first1, first2);
- }
- template <class InputIterator1, class InputIterator2>
- BOOST_CXX14_CONSTEXPR std::pair<InputIterator1, InputIterator2> mismatch (
- InputIterator1 first1, InputIterator1 last1,
- InputIterator2 first2, InputIterator2 last2 )
- {
- for (; first1 != last1 && first2 != last2; ++first1, ++first2)
- if ( *first1 != *first2 )
- break;
- return std::pair<InputIterator1, InputIterator2>(first1, first2);
- }
- }}
- #endif
|