1 /*-----------------------------------------------------------------------------+
2 Copyright (c) 2010-2010: Joachim Faulhaber
3 +------------------------------------------------------------------------------+
4 Distributed under the Boost Software License, Version 1.0.
5 (See accompanying file LICENCE.txt or copy at
6 http://www.boost.org/LICENSE_1_0.txt)
7 +-----------------------------------------------------------------------------*/
8 #ifndef BOOST_ICL_TYPE_TRAITS_PREDICATE_HPP_JOFA_101102
9 #define BOOST_ICL_TYPE_TRAITS_PREDICATE_HPP_JOFA_101102
13 namespace boost{namespace icl
16 // predicate: n-ary predicate
17 // property: unary predicate
18 // relation: binary predicate
23 class property : public std::unary_function<Type,bool>{};
26 class member_property : public property<Type>
29 member_property( bool(Type::* pred)()const ): property<Type>(), m_pred(pred){}
30 bool operator()(const Type& x)const { return (x.*m_pred)(); }
32 bool(Type::* m_pred)()const;
35 // Binary predicates: relations
37 template <class LeftT, class RightT>
38 class relation : public std::binary_function<LeftT,RightT,bool>{};
41 }} // namespace icl boost