Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2000-12-27 00:30:02

I have posted binary searching code to the boost files area at The .zip file contains:

boost/boost/detail/iterator.hpp, containing:
     std::iterator_traits, unless you need value_type, even for
nonconforming compilers
     std::distance(), even for nonconforming compilers

  a derivative of the binary search functions in SGI STL, but using cleaner
  workarounds for nonconforming compilers

  Test code for verifying the above functionality

The text files, binary_search1.txt and binary_search2.txt are derived from
my postings on the subject and will form the basis for the formal


P.S. Jeremy, I think I understand now why you want a relationship between
binary searching and sortedness: what does it mean to search for an
insertion position? I believe this just requires some theorem proving but no
additional standard language. Let's talk.

Boost list run by bdawes at, gregod at, cpdaniel at, john at