]> git.lyx.org Git - lyx.git/blobdiff - boost/boost/detail/algorithm.hpp
update to boost 1.39: add new files
[lyx.git] / boost / boost / detail / algorithm.hpp
index a26ed3eabc5d0014c848e0f308c2da1d8946157d..252e9f461c54e2d4573bbbc28933ff9c419a17f3 100644 (file)
@@ -1,8 +1,6 @@
-// (C) Copyright Jeremy Siek 2001. Permission to copy, use, modify,
-// sell and distribute this software is granted provided this
-// copyright notice appears in all copies. This software is provided
-// "as is" without express or implied warranty, and with no claim as
-// to its suitability for any purpose.
+// (C) Copyright Jeremy Siek 2001.
+// Distributed under the Boost Software License, Version 1.0. (See accompany-
+// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
 
 /*
  *
@@ -154,39 +152,14 @@ namespace boost {
   }
 
   template <typename InputIterator, typename T>
-  bool contains(InputIterator first, InputIterator last, T value)
+  bool container_contains(InputIterator first, InputIterator last, T value)
   {
     return std::find(first, last, value) != last;
   }
   template <typename Container, typename T>
-  bool contains(const Container& c, const T& value)
+  bool container_contains(const Container& c, const T& value)
   {
-    return contains(begin(c), end(c), value);
-  }
-
-  template <typename InputIterator, typename Predicate>
-  bool all(InputIterator first, InputIterator last, Predicate p)
-  {
-    for (; first != last; ++first)
-      if (!p(*first))
-        return false;
-    return true;
-  }
-  template <typename Container, typename Predicate>
-  bool all(const Container& c, Predicate p)
-  {
-    return all(begin(c), end(c), p);
-  }
-
-  template <typename InputIterator, typename Predicate>
-  bool none(InputIterator first, InputIterator last, Predicate p)
-  {
-    return std::find_if(first, last, p) == last;
-  }
-  template <typename Container, typename Predicate>
-  bool none(const Container& c, Predicate p)
-  {
-    return none(begin(c), end(c), p);
+    return container_contains(begin(c), end(c), value);
   }
 
   template <typename Container, typename T>
@@ -210,7 +183,7 @@ namespace boost {
     ForwardIterator next = first;
     for (++next; next != last; first = next, ++next) {
       if (*next < *first)
-       return false;
+        return false;
     }
 
     return true;
@@ -218,7 +191,7 @@ namespace boost {
 
   template <typename ForwardIterator, typename StrictWeakOrdering>
   bool is_sorted(ForwardIterator first, ForwardIterator last,
-                StrictWeakOrdering comp)
+                 StrictWeakOrdering comp)
   {
     if (first == last)
       return true;
@@ -226,7 +199,7 @@ namespace boost {
     ForwardIterator next = first;
     for (++next; next != last; first = next, ++next) {
       if (comp(*next, *first))
-       return false;
+        return false;
     }
 
     return true;