18namespace boost {
namespace algorithm {
22 template <
class T1,
class T2>
24 bool operator () (
const T1& v1,
const T2& v2 )
const {
return v1 == v2 ;}
27 template <
class RandomAccessIterator1,
class RandomAccessIterator2,
class BinaryPredicate>
28 bool equal ( RandomAccessIterator1 first1, RandomAccessIterator1 last1,
29 RandomAccessIterator2 first2, RandomAccessIterator2 last2, BinaryPredicate pred,
30 std::random_access_iterator_tag , std::random_access_iterator_tag )
33 if ( std::distance ( first1, last1 ) != std::distance ( first2, last2 ))
36 return std::equal ( first1, last1, first2, pred );
39 template <
class InputIterator1,
class InputIterator2,
class BinaryPredicate>
40 bool equal ( InputIterator1 first1, InputIterator1 last1,
41 InputIterator2 first2, InputIterator2 last2, BinaryPredicate pred,
42 std::input_iterator_tag , std::input_iterator_tag )
44 for (; first1 != last1 && first2 != last2; ++first1, ++first2 )
45 if ( !pred(*first1, *first2 ))
48 return first1 == last1 && first2 == last2;
62template <
class InputIterator1,
class InputIterator2,
class BinaryPredicate>
63bool equal ( InputIterator1 first1, InputIterator1 last1,
64 InputIterator2 first2, InputIterator2 last2, BinaryPredicate pred )
67 first1, last1, first2, last2, pred,
68 typename std::iterator_traits<InputIterator1>::iterator_category (),
69 typename std::iterator_traits<InputIterator2>::iterator_category ());
80template <
class InputIterator1,
class InputIterator2>
81bool equal ( InputIterator1 first1, InputIterator1 last1,
82 InputIterator2 first2, InputIterator2 last2 )
85 first1, last1, first2, last2,
87 typename std::iterator_traits<InputIterator1>::value_type,
88 typename std::iterator_traits<InputIterator2>::value_type> (),
89 typename std::iterator_traits<InputIterator1>::iterator_category (),
90 typename std::iterator_traits<InputIterator2>::iterator_category ());
bool equal(RandomAccessIterator1 first1, RandomAccessIterator1 last1, RandomAccessIterator2 first2, RandomAccessIterator2 last2, BinaryPredicate pred, std::random_access_iterator_tag, std::random_access_iterator_tag)
bool equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, BinaryPredicate pred)
bool operator()(const T1 &v1, const T2 &v2) const