First public contribution.
5 #include <functional> //*TY 12/26/1998 - added to get unary_function
7 #if !defined (STLPORT) || defined (_STLP_USE_NAMESPACES)
8 using std::unary_function;
11 struct odd : public unary_function<int, bool>
14 bool operator()(int n_) const { return(n_ % 2) == 1; }
17 struct positive : public unary_function<int, bool>
19 typedef int argument_type;
20 typedef bool result_type;
22 bool operator()(int n_) const { return n_ >= 0; }
25 struct square_root : public unary_function<double, double>
27 typedef double argument_type;
28 typedef double result_type;
30 square_root(const square_root &) {}
31 double operator()(double x_) const
32 { return ::sqrt(x_); }