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

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

#ifdef MAIN
#define rawiter_test main
#endif
class X
{
  public:
    X(int i_ = 0) : i(i_) {}
    operator int() const { return i; }

  private:
    int i;
};
#endif
int rawiter_test(int, char**)
{
  cout<<"Results of rawiter_test:"<<endl;

#ifndef ACORN_CFRONT
  allocator<X> a;
  allocator<X>::pointer p = a.allocate(5);
#else
  X* p = allocate(5, (X*)0);
#endif

  raw_storage_iterator<X*, X> r(p);

  int i;
  for(i = 0; i < 5; i++)
    *r++ = X(i);
  for(i = 0; i < 5; i++)
    cout << *p++ << endl;
  return 0;
}
