Revert "Roll NDK to r11c and extract it into its own repository."
[android_tools.git] / ndk / tests / device / test-gnustl-full / unit / unary.h
blob8c9ef4312e066a8ab4cd0291afee4b1820458620
1 #ifndef _unary_h
2 #define _unary_h
3 #include <cmath>
4 #include <cfloat>
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;
9 #endif
11 struct odd : public unary_function<int, bool> {
12 bool operator()(int n_) const { return(n_ % 2) == 1; }
15 struct positive : public unary_function<int, bool> {
16 bool operator()(int n_) const { return n_ >= 0; }
19 struct square_root : public unary_function<double, double> {
20 double operator()(double x_) const
21 { return ::sqrt(x_); }
23 #endif // _unary_h