Use boost::adl_move_swap instead of own swap utility

Imported basic algorithms from Boost.Intrusive
This commit is contained in:
Ion Gaztañaga
2014-11-26 19:33:27 +01:00
parent 7971dc6602
commit afd1c2d266
4 changed files with 14 additions and 118 deletions
+4 -33
View File
@@ -17,42 +17,13 @@
# pragma once
#endif
#include <boost/intrusive/detail/algorithm.hpp>
namespace boost {
namespace container {
template<class InputIt1, class InputIt2>
bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2)
{
for (; first1 != last1; ++first1, ++first2) {
if (!(*first1 == *first2)) {
return false;
}
}
return true;
}
template<class InputIt1, class InputIt2, class BinaryPredicate>
bool algo_equal(InputIt1 first1, InputIt1 last1, InputIt2 first2, BinaryPredicate p)
{
for (; first1 != last1; ++first1, ++first2) {
if (!p(*first1, *first2)) {
return false;
}
}
return true;
}
template <class InputIterator1, class InputIterator2>
bool algo_lexicographical_compare (InputIterator1 first1, InputIterator1 last1,
InputIterator2 first2, InputIterator2 last2)
{
while (first1 != last1){
if (first2 == last2 || *first2 < *first1) return false;
else if (*first1 < *first2) return true;
++first1; ++first2;
}
return (first2 != last2);
}
using boost::intrusive::algo_equal;
using boost::intrusive::algo_lexicographical_compare;
} //namespace container {
} //namespace boost {