Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-30 09:43:56

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_PREDICATES_SUB_SUPER_SET_HPP_JOFA_101102
0009 #define BOOST_ICL_PREDICATES_SUB_SUPER_SET_HPP_JOFA_101102
0010 
0011 #include <boost/icl/type_traits/predicate.hpp>
0012 #include <boost/icl/type_traits/type_to_string.hpp>
0013 
0014 namespace boost{namespace icl
0015 {
0016 
0017     /// Functor class template contained_in implements the subset relation.
0018     template<class Type> 
0019     struct sub_super_set : public relation<Type,Type>
0020     {
0021         /// Apply the subset relation.
0022         /** <tt>contained_in(sub, super)</tt> is true if <tt>sub</tt> 
0023             is contained in <tt>super</tt> */
0024         bool operator()(const Type& sub, const Type& super)const
0025         {
0026             return contains(super, sub);
0027         }
0028     };
0029 
0030     template<>
0031     inline std::string unary_template_to_string<icl::sub_super_set>::apply()  
0032     { return "C="; }
0033 
0034     /// Functor class template <b>contains</b> implements the superset relation. 
0035     template<class Type> 
0036     struct super_sub_set : public relation<Type,Type>
0037     {
0038         /// Apply the superset relation.
0039         /** <tt>contains(super, sub)</tt> is true if <tt>super</tt> containes 
0040             <tt>sub</tt> */
0041         bool operator()(const Type& super, const Type& sub)const
0042         {
0043             return contains(super, sub);
0044         }
0045     };
0046 
0047     template<>
0048     inline std::string unary_template_to_string<icl::super_sub_set>::apply()  
0049     { return "D="; }
0050 
0051 }} // namespace icl boost
0052 
0053 #endif
0054