mirror of
https://github.com/boostorg/intrusive.git
synced 2025-07-31 04:57:32 +02:00
Support different types in algo_pred_equal and algo_pred_less
This commit is contained in:
@ -26,15 +26,15 @@ namespace intrusive {
|
|||||||
|
|
||||||
struct algo_pred_equal
|
struct algo_pred_equal
|
||||||
{
|
{
|
||||||
template<class T>
|
template<class T, class T2>
|
||||||
bool operator()(const T &x, const T &y) const
|
bool operator()(const T &x, const T2 &y) const
|
||||||
{ return x == y; }
|
{ return x == y; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct algo_pred_less
|
struct algo_pred_less
|
||||||
{
|
{
|
||||||
template<class T>
|
template<class T, class T2>
|
||||||
bool operator()(const T &x, const T &y) const
|
bool operator()(const T &x, const T2 &y) const
|
||||||
{ return x < y; }
|
{ return x < y; }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -49,10 +49,6 @@ bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, BinaryPredicat
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class InputIt1, class InputIt2>
|
|
||||||
bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2)
|
|
||||||
{ return (algo_equal)(first1, last1, first2, algo_pred_equal()); }
|
|
||||||
|
|
||||||
template<class InputIt1, class InputIt2, class BinaryPredicate>
|
template<class InputIt1, class InputIt2, class BinaryPredicate>
|
||||||
bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, BinaryPredicate pred)
|
bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2, BinaryPredicate pred)
|
||||||
{
|
{
|
||||||
@ -62,6 +58,10 @@ bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2
|
|||||||
return first1 == last1 && first2 == last2;
|
return first1 == last1 && first2 == last2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template<class InputIt1, class InputIt2>
|
||||||
|
bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2)
|
||||||
|
{ return (algo_equal)(first1, last1, first2, algo_pred_equal()); }
|
||||||
|
|
||||||
template<class InputIt1, class InputIt2>
|
template<class InputIt1, class InputIt2>
|
||||||
bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2)
|
bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2)
|
||||||
{ return (algo_equal)(first1, last1, first2, last2, algo_pred_equal()); }
|
{ return (algo_equal)(first1, last1, first2, last2, algo_pred_equal()); }
|
||||||
|
Reference in New Issue
Block a user