#ifndef SINGLE
//  An adapted ObjectSpace example for use with SGI STL

#include <algo.h>
#include <iostream.h>
#include <string.h>

#ifdef MAIN
#define binsrch2_test main
#endif
#endif
static bool str_compare(const char* a_, const char* b_)
{
  return ::strcmp(a_, b_) < 0 ? 1 : 0;
}
int binsrch2_test(int, char**)
{
  cout<<"Results of binsrch2_test:"<<endl;

#ifndef ACORN_CFRONT
char* labels[] = { "aa", "dd", "ff", "jj", "ss", "zz" };
#else
static char* labels[] = { "aa", "dd", "ff", "jj", "ss", "zz" };
#endif

  const unsigned count = sizeof(labels) / sizeof(labels[0]);
  if(binary_search(labels, labels + count, "ff", str_compare))
    cout << "ff is in labels." << endl;
  else
    cout << "ff is not in labels." << endl;
  return 0;
}
