Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r50502 - sandbox/partition_point/boost/iterator
From: aschoedl_at_[hidden]
Date: 2009-01-07 10:02:18


Author: schoedl
Date: 2009-01-07 10:02:18 EST (Wed, 07 Jan 2009)
New Revision: 50502
URL: http://svn.boost.org/trac/boost/changeset/50502

Log:
added partition_point( reverse_iterator )
Added:
   sandbox/partition_point/boost/iterator/reverse_partition_point.hpp (contents, props changed)

Added: sandbox/partition_point/boost/iterator/reverse_partition_point.hpp
==============================================================================
--- (empty file)
+++ sandbox/partition_point/boost/iterator/reverse_partition_point.hpp 2009-01-07 10:02:18 EST (Wed, 07 Jan 2009)
@@ -0,0 +1,30 @@
+#ifndef BOOST_REVERSE_PARTITION_POINT_HPP
+#define BOOST_REVERSE_PARTITION_POINT_HPP
+
+#if defined(_MSC_VER)&&(_MSC_VER>=1200)
+#pragma once
+#endif
+
+#include <boost/partition_point/partition_point.hpp>
+#include <boost/iterator/reverse_iterator.hpp>
+#include <boost/bind.hpp>
+
+namespace boost {
+
+/* Template functions lower_bound, upper_bound, equal_range and binary_search
+expressed in terms of partition_point, special version for reverse_iterator */
+template< class Iterator, class UnaryPred >
+reverse_iterator<Iterator> partition_point( reverse_iterator<Iterator> itBegin, reverse_iterator<Iterator> itEnd, UnaryPred pred ) {
+ using boost::partition_point;
+ return reverse_iterator<Iterator>(
+ partition_point(
+ itEnd.base(),
+ itBegin.base(),
+ !boost::bind<bool>(pred,_1)
+ )
+ );
+}
+
+}; /* namespace */
+
+#endif // BOOST_REVERSE_PARTITION_POINT_HPP


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