8#ifndef INCLUDED_BDLB_ALGORITHMWORKAROUNDUTIL
9#define INCLUDED_BDLB_ALGORITHMWORKAROUNDUTIL
61#include <bdlscm_version.h>
66#include <bsl_algorithm.h>
67#include <bsl_iterator.h>
69#ifndef BDE_DONT_ALLOW_TRANSITIVE_INCLUDES
96 template<
class FORWARD_IT,
class TYPE>
111 template <
class FORWARD_IT,
class TYPE,
class COMPARE>
126 template<
class FORWARD_IT,
class TYPE>
141 template <
class FORWARD_IT,
class TYPE,
class COMPARE>
157template<
class FORWARD_IT,
class TYPE>
163#if defined(BSLS_LIBRARYFEATURES_STDCPP_STLPORT) \
164 && defined(_STLPORT_VERSION) \
165 && (_STLPORT_VERSION <= 0x452)
167 typedef typename bsl::iterator_traits<FORWARD_IT>::difference_type
170 difference_type length = bsl::distance(first, last);
173 difference_type half = length >> 1;
174 FORWARD_IT it = first;
176 bsl::advance(it, half);
187 return std::lower_bound(first, last, value);
191template <
class FORWARD_IT,
class TYPE,
class COMPARE>
198#if defined(BSLS_LIBRARYFEATURES_STDCPP_STLPORT) \
199 && defined(_STLPORT_VERSION) \
200 && (_STLPORT_VERSION <= 0x452)
202 typedef typename bsl::iterator_traits<FORWARD_IT>::difference_type
205 difference_type length = bsl::distance(first, last);
208 difference_type half = length >> 1;
209 FORWARD_IT it = first;
211 bsl::advance(it, half);
212 if (comp(*it, value)) {
222 return std::lower_bound(first, last, value, comp);
226template<
class FORWARD_IT,
class TYPE>
232#if defined(BSLS_LIBRARYFEATURES_STDCPP_STLPORT) \
233 && defined(_STLPORT_VERSION) \
234 && (_STLPORT_VERSION <= 0x452)
236 typedef typename bsl::iterator_traits<FORWARD_IT>::difference_type
239 difference_type length = bsl::distance(first, last);
242 difference_type half = length >> 1;
243 FORWARD_IT it = first;
245 bsl::advance(it, half);
246 if (!(value < *it)) {
256 return std::upper_bound(first, last, value);
260template <
class FORWARD_IT,
class TYPE,
class COMPARE>
267#if defined(BSLS_LIBRARYFEATURES_STDCPP_STLPORT) \
268 && defined(_STLPORT_VERSION) \
269 && (_STLPORT_VERSION <= 0x452)
271 typedef typename bsl::iterator_traits<FORWARD_IT>::difference_type
274 difference_type length = bsl::distance(first, last);
277 difference_type half = length >> 1;
278 FORWARD_IT it = first;
280 bsl::advance(it, half);
281 if (!comp(value, *it)) {
291 return std::upper_bound(first, last, value, comp);
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition bdlb_algorithmworkaroundutil.h:74
Definition bdlb_algorithmworkaroundutil.h:84
static FORWARD_IT lowerBound(FORWARD_IT first, FORWARD_IT last, const TYPE &value)
Definition bdlb_algorithmworkaroundutil.h:159
static FORWARD_IT upperBound(FORWARD_IT first, FORWARD_IT last, const TYPE &value)
Definition bdlb_algorithmworkaroundutil.h:228