#ifndef SINGLE
//  An adapted ObjectSpace example for use with SGI STL
#include <iostream.h>
#include <multimap.h>
#include <algo.h>

#ifdef MAIN
#define mmap2_test main
#endif
#endif
int mmap2_test(int, char**)
{
  cout<<"Results of mmap2_test:"<<endl;
static int hook=0;
int bb=0;


#ifndef ACORN_CFRONT
typedef pair<const int, char> pair_type;

pair_type p1(3, 'c');
pair_type p2(6, 'f');
pair_type p3(1, 'a');
pair_type p4(2, 'b');
pair_type p5(3, 'x');
pair_type p6(6, 'f');

  typedef multimap<int, char, less<int> > mmap;

pair_type array [] =
  {
    p1,
    p2,
    p3,
    p4,
    p5,
    p6
  };
#else

typedef map_value_type<int, char> pair_type;

static pair_type p1(3, 'c');
static pair_type p2(6, 'f');
static pair_type p3(1, 'a');
static pair_type p4(2, 'b');
static pair_type p5(3, 'x');
static pair_type p6(6, 'f');

  typedef multimap<int, char, less<int> > mmap;

static map_value_type<int, char> array [] =
  {
    p1,
    p2,
    p3,
    p4,
    p5,
    p6
  };
#endif

  mmap m(array, array + 6);

#ifndef ACORN_CFRONT
  mmap::iterator i;
#else
  map_iterator<int, char, less<int> > i;
#endif

  i = m.lower_bound(3);
  cout << "lower bound:" << endl;
  cout <<(*i).first << " -> " <<(*i).second << endl;
  i = m.upper_bound(3);
  cout << "upper bound:" << endl;
  cout <<(*i).first << " -> " <<(*i).second << endl;
  return 0;
}
