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
94 template<
class FORWARD_IT,
class TYPE>
109 template <
class FORWARD_IT,
class TYPE,
class COMPARE>
124 template<
class FORWARD_IT,
class TYPE>
139 template <
class FORWARD_IT,
class TYPE,
class COMPARE>
155template<
class FORWARD_IT,
class TYPE>
161#if defined(BSLS_LIBRARYFEATURES_STDCPP_STLPORT) \
162 && defined(_STLPORT_VERSION) \
163 && (_STLPORT_VERSION <= 0x452)
165 typedef typename bsl::iterator_traits<FORWARD_IT>::difference_type
168 difference_type length = bsl::distance(first, last);
171 difference_type half = length >> 1;
172 FORWARD_IT it = first;
174 bsl::advance(it, half);
185 return std::lower_bound(first, last, value);
189template <
class FORWARD_IT,
class TYPE,
class COMPARE>
196#if defined(BSLS_LIBRARYFEATURES_STDCPP_STLPORT) \
197 && defined(_STLPORT_VERSION) \
198 && (_STLPORT_VERSION <= 0x452)
200 typedef typename bsl::iterator_traits<FORWARD_IT>::difference_type
203 difference_type length = bsl::distance(first, last);
206 difference_type half = length >> 1;
207 FORWARD_IT it = first;
209 bsl::advance(it, half);
210 if (comp(*it, value)) {
220 return std::lower_bound(first, last, value, comp);
224template<
class FORWARD_IT,
class TYPE>
230#if defined(BSLS_LIBRARYFEATURES_STDCPP_STLPORT) \
231 && defined(_STLPORT_VERSION) \
232 && (_STLPORT_VERSION <= 0x452)
234 typedef typename bsl::iterator_traits<FORWARD_IT>::difference_type
237 difference_type length = bsl::distance(first, last);
240 difference_type half = length >> 1;
241 FORWARD_IT it = first;
243 bsl::advance(it, half);
244 if (!(value < *it)) {
254 return std::upper_bound(first, last, value);
258template <
class FORWARD_IT,
class TYPE,
class COMPARE>
265#if defined(BSLS_LIBRARYFEATURES_STDCPP_STLPORT) \
266 && defined(_STLPORT_VERSION) \
267 && (_STLPORT_VERSION <= 0x452)
269 typedef typename bsl::iterator_traits<FORWARD_IT>::difference_type
272 difference_type length = bsl::distance(first, last);
275 difference_type half = length >> 1;
276 FORWARD_IT it = first;
278 bsl::advance(it, half);
279 if (!comp(value, *it)) {
289 return std::upper_bound(first, last, value, comp);
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlb_algorithmworkaroundutil.h:74
Definition bdlb_algorithmworkaroundutil.h:82
static FORWARD_IT lowerBound(FORWARD_IT first, FORWARD_IT last, const TYPE &value)
Definition bdlb_algorithmworkaroundutil.h:157
static FORWARD_IT upperBound(FORWARD_IT first, FORWARD_IT last, const TYPE &value)
Definition bdlb_algorithmworkaroundutil.h:226