Loading...
Searching...
No Matches
CONCEPT/predicate.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
#ifndef BALL_CONCEPT_PREDICATE_H
#define BALL_CONCEPT_PREDICATE_H
#ifndef BALL_COMMON_GLOBAL_H
# include <BALL/COMMON/global.h>
#endif
#include <functional>
namespace BALL
{
using std::unary_function;
using std::binary_function;
template <typename T>
class UnaryPredicate
: public unary_function<T, bool>
{
public:
virtual ~UnaryPredicate() {}
virtual bool operator() (const T& /* x */) const
;
};
template <typename T1, typename T2>
class BinaryPredicate
: public binary_function<T1, T2, bool>
{
public:
virtual bool operator() (const T1& x, const T2& y) const
;
virtual ~BinaryPredicate() {}
};
template <typename T>
bool UnaryPredicate<T>::operator() (const T& /* x */) const
{
return true;
}
template <typename T1, typename T2>
bool BinaryPredicate<T1, T2>::operator() (const T1&, const T2&) const
{
return true;
}
} // namespace BALL
#endif // BALL_CONCEPT_PREDICATE_H
global.h
BALL::BinaryPredicate
Definition CONCEPT/predicate.h:45
BALL::BinaryPredicate::~BinaryPredicate
virtual ~BinaryPredicate()
Definition CONCEPT/predicate.h:53
BALL::BinaryPredicate::operator()
virtual bool operator()(const T1 &x, const T2 &y) const
Definition CONCEPT/predicate.h:64
BALL::UnaryPredicate
Definition CONCEPT/predicate.h:30
BALL::UnaryPredicate::operator()
virtual bool operator()(const T &) const
Definition CONCEPT/predicate.h:57
BALL::UnaryPredicate::~UnaryPredicate
virtual ~UnaryPredicate()
Definition CONCEPT/predicate.h:33
BALL::binary_function
BALL
Definition constants.h:13