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

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

#ifdef MAIN
#define ucompos2_test main
#endif
struct square_root : public unary_function<double, double>
{
  square_root() {}
  double operator()(double x_) const { return sqrt(x_); }
};
#endif

#ifdef ACORN_CFRONT
TEMPLATE_compose1(square_root, negate<int>, int, double)
#endif

int ucompos2_test(int, char**)
{
  cout<<"Results of ucompos2_test:"<<endl;

#ifndef ACORN_CFRONT
int input [3] = { -1, -4, -16 };
#else
static int input [3] = { -1, -4, -16 };
#endif

  int output [3];
  transform(input, input + 3, output,
    compose1(square_root(), negate<int>()));
  for(int i = 0; i < 3; i++)
   cout << output[i] << endl;
  return 0;
}
