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
11 namespace boost{namespace icl
14 // predicate: n-ary predicate
15 // property: unary predicate
16 // relation: binary predicate
24 typedef Type argument_type;
25 typedef bool result_type;
29 class member_property : public property<Type>
32 member_property( bool(Type::* pred)()const ): property<Type>(), m_pred(pred){}
33 bool operator()(const Type& x)const { return (x.*m_pred)(); }
35 bool(Type::* m_pred)()const;
38 // Binary predicates: relations
40 template <class LeftT, class RightT>
44 typedef LeftT first_argument_type;
45 typedef RightT second_argument_type;
46 typedef bool result_type;
50 }} // namespace icl boost