summaryrefslogtreecommitdiffstats
path: root/libstdc++-v3/include/bits/stl_algobase.h
diff options
context:
space:
mode:
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-23 14:32:35 +0000
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>2010-03-23 14:32:35 +0000
commitbfbcf0d6b39dc5d5eab22ff6c4bb436f9c915444 (patch)
treec9e66d7b4f07c6c7e8e03084b46e4b4fe74b99f8 /libstdc++-v3/include/bits/stl_algobase.h
parentd590232e1bf6d8b2f63e3ca412c6692213234cbf (diff)
downloadppe42-gcc-bfbcf0d6b39dc5d5eab22ff6c4bb436f9c915444.tar.gz
ppe42-gcc-bfbcf0d6b39dc5d5eab22ff6c4bb436f9c915444.zip
2010-03-23 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/stl_algobase.h (lower_bound(_ForwardIterator, _ForwardIterator, const _Tp&, _Compare)): Move... * include/bits/stl_algo.h: ... here. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@157668 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libstdc++-v3/include/bits/stl_algobase.h')
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h54
1 files changed, 0 insertions, 54 deletions
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index 1756966a5a1..e92540431de 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -985,60 +985,6 @@ _GLIBCXX_BEGIN_NAMESPACE(std)
return __first;
}
- /**
- * @brief Finds the first position in which @a val could be inserted
- * without changing the ordering.
- * @ingroup binary_search_algorithms
- * @param first An iterator.
- * @param last Another iterator.
- * @param val The search term.
- * @param comp A functor to use for comparisons.
- * @return An iterator pointing to the first element <em>not less
- * than</em> @a val, or end() if every element is less
- * than @a val.
- * @ingroup binary_search_algorithms
- *
- * The comparison function should have the same effects on ordering as
- * the function used for the initial sort.
- */
- template<typename _ForwardIterator, typename _Tp, typename _Compare>
- _ForwardIterator
- lower_bound(_ForwardIterator __first, _ForwardIterator __last,
- const _Tp& __val, _Compare __comp)
- {
- typedef typename iterator_traits<_ForwardIterator>::value_type
- _ValueType;
- typedef typename iterator_traits<_ForwardIterator>::difference_type
- _DistanceType;
-
- // concept requirements
- __glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
- __glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
- _ValueType, _Tp>)
- __glibcxx_requires_partitioned_lower_pred(__first, __last,
- __val, __comp);
-
- _DistanceType __len = std::distance(__first, __last);
- _DistanceType __half;
- _ForwardIterator __middle;
-
- while (__len > 0)
- {
- __half = __len >> 1;
- __middle = __first;
- std::advance(__middle, __half);
- if (__comp(*__middle, __val))
- {
- __first = __middle;
- ++__first;
- __len = __len - __half - 1;
- }
- else
- __len = __half;
- }
- return __first;
- }
-
/// This is a helper function for the sort routines and for random.tcc.
// Precondition: __n > 0.
template<typename _Size>
OpenPOWER on IntegriCloud