00001
00002
00003
00004
00005 #ifndef BALL_CONCEPT_PREDICATE_H
00006 #define BALL_CONCEPT_PREDICATE_H
00007
00008 #ifndef BALL_COMMON_GLOBAL_H
00009 # include <BALL/COMMON/global.h>
00010 #endif
00011
00012 #include <functional>
00013
00014 namespace BALL
00015 {
00016 using std::unary_function;
00017 using std::binary_function;
00018
00024
00027 template <typename T>
00028 class UnaryPredicate
00029 : public unary_function<T, bool>
00030 {
00031 public:
00033 virtual ~UnaryPredicate() {}
00034
00036 virtual bool operator() (const T& ) const
00037 ;
00038 };
00039
00042 template <typename T1, typename T2>
00043 class BinaryPredicate
00044 : public binary_function<T1, T2, bool>
00045 {
00046 public:
00047
00049 virtual bool operator() (const T1& x, const T2& y) const
00050 ;
00051
00053 virtual ~BinaryPredicate() {}
00054 };
00055
00056 template <typename T>
00057 bool UnaryPredicate<T>::operator() (const T& ) const
00058
00059 {
00060 return true;
00061 }
00062
00063 template <typename T1, typename T2>
00064 bool BinaryPredicate<T1, T2>::operator() (const T1&, const T2&) const
00065
00066 {
00067 return true;
00068 }
00070 }
00071
00072
00073 #endif // BALL_CONCEPT_PREDICATE_H