Skip to content

Commit 0baa42f

Browse files
committed
Support different types in algo_pred_equal and algo_pred_less
1 parent d9eddd7 commit 0baa42f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

include/boost/intrusive/detail/algorithm.hpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ namespace intrusive {
2626

2727
struct algo_pred_equal
2828
{
29-
template<class T>
30-
bool operator()(const T &x, const T &y) const
29+
template<class T, class T2>
30+
bool operator()(const T &x, const T2 &y) const
3131
{ return x == y; }
3232
};
3333

3434
struct algo_pred_less
3535
{
36-
template<class T>
37-
bool operator()(const T &x, const T &y) const
36+
template<class T, class T2>
37+
bool operator()(const T &x, const T2 &y) const
3838
{ return x < y; }
3939
};
4040

@@ -49,10 +49,6 @@ bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, BinaryPredicat
4949
return true;
5050
}
5151

52-
template<class InputIt1, class InputIt2>
53-
bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2)
54-
{ return (algo_equal)(first1, last1, first2, algo_pred_equal()); }
55-
5652
template<class InputIt1, class InputIt2, class BinaryPredicate>
5753
bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, BinaryPredicate pred)
5854
{
@@ -62,6 +58,10 @@ bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2
6258
return first1 == last1 && first2 == last2;
6359
}
6460

61+
template<class InputIt1, class InputIt2>
62+
bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2)
63+
{ return (algo_equal)(first1, last1, first2, algo_pred_equal()); }
64+
6565
template<class InputIt1, class InputIt2>
6666
bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2)
6767
{ return (algo_equal)(first1, last1, first2, last2, algo_pred_equal()); }

0 commit comments

Comments
 (0)