Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:21

0001 /*-----------------------------------------------------------------------------+
0002 Copyright (c) 2010-2010: Joachim Faulhaber
0003 +------------------------------------------------------------------------------+
0004    Distributed under the Boost Software License, Version 1.0.
0005       (See accompanying file LICENCE.txt or copy at
0006            http://www.boost.org/LICENSE_1_0.txt)
0007 +-----------------------------------------------------------------------------*/
0008 #ifndef BOOST_ICL_TYPE_TRAITS_PREDICATE_HPP_JOFA_101102
0009 #define BOOST_ICL_TYPE_TRAITS_PREDICATE_HPP_JOFA_101102
0010 
0011 namespace boost{namespace icl
0012 {
0013     // naming convention
0014     // predicate: n-ary predicate
0015     // property:  unary predicate
0016     // relation:  binary predicate
0017 
0018     // Unary predicates
0019 
0020     template <class Type>
0021     class property
0022     {
0023     public:
0024         typedef Type argument_type;
0025         typedef bool result_type;
0026     };
0027 
0028     template <class Type>
0029     class member_property : public property<Type>
0030     {
0031     public:
0032         member_property( bool(Type::* pred)()const ): property<Type>(), m_pred(pred){}
0033         bool operator()(const Type& x)const { return (x.*m_pred)(); }
0034     private:
0035         bool(Type::* m_pred)()const;
0036     } ;
0037 
0038     // Binary predicates: relations
0039 
0040     template <class LeftT, class RightT>
0041     class relation
0042     {
0043     public:
0044         typedef LeftT first_argument_type;
0045         typedef RightT second_argument_type;
0046         typedef bool result_type;
0047     };
0048 
0049 
0050 }} // namespace icl boost
0051 
0052 #endif
0053