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

#include <iostream.h>
#include <math.h>
#include <algo.h>
// using namespace std;
#ifdef MAIN
#define ucompos1_test main
#endif
struct square_root : public unary_function<double, double>
{
  square_root() {}
  double operator()(double x_) const { return sqrt(x_); }
};
#endif
int ucompos1_test(int, char**)
{
  cout<<"Results of ucompos1_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,
    unary_compose<square_root, negate<int>, int, double>(square_root(), negate<int>()));
  for(int i = 0; i < 3; i++)
    cout << output[i] << endl;
  return 0;
}
