|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r61049 - trunk/boost/detail
From: neil_at_[hidden]
Date: 2010-04-04 15:19:59
Author: neilgroves
Date: 2010-04-04 15:19:58 EDT (Sun, 04 Apr 2010)
New Revision: 61049
URL: http://svn.boost.org/trac/boost/changeset/61049
Log:
Fix duplication of algorithms by delegating to the specific Boost.Range algorithm header files.
This avoids pulling in any more names than necessary for maximum backward compatibility.
Also the old algorithms that are not duplicated have been reinstated again to maximize backward compatibility.
Text files modified:
trunk/boost/detail/algorithm.hpp | 26 +++++++++++++++++++++++---
1 files changed, 23 insertions(+), 3 deletions(-)
Modified: trunk/boost/detail/algorithm.hpp
==============================================================================
--- trunk/boost/detail/algorithm.hpp (original)
+++ trunk/boost/detail/algorithm.hpp 2010-04-04 15:19:58 EDT (Sun, 04 Apr 2010)
@@ -40,12 +40,32 @@
#include <algorithm>
#include <vector>
-#include <boost/range.hpp>
-#include <boost/range/algorithm.hpp>
-#include <boost/range/algorithm_ext.hpp>
+#include <boost/range/begin.hpp>
+#include <boost/range/end.hpp>
+#include <boost/range/algorithm/copy.hpp>
+#include <boost/range/algorithm/equal.hpp>
+#include <boost/range/algorithm/sort.hpp>
+#include <boost/range/algorithm/stable_sort.hpp>
+#include <boost/range/algorithm/find_if.hpp>
+#include <boost/range/algorithm/count.hpp>
+#include <boost/range/algorithm/count_if.hpp>
+#include <boost/range/algorithm_ext/is_sorted.hpp>
+#include <boost/range/algorithm_ext/iota.hpp>
namespace boost {
+ template <typename InputIterator, typename Predicate>
+ bool any_if(InputIterator first, InputIterator last, Predicate p)
+ {
+ return std::find_if(first, last, p) != last;
+ }
+
+ template <typename Container, typename Predicate>
+ bool any_if(const Container& c, Predicate p)
+ {
+ return any_if(begin(c), end(c), p);
+ }
+
template <typename InputIterator, typename T>
bool container_contains(InputIterator first, InputIterator last, T value)
{
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk