File indexing completed on 2025-01-18 09:38:20
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_ICL_TYPE_TRAITS_ON_ABSORBTION_HPP_JOFA_100915
0009 #define BOOST_ICL_TYPE_TRAITS_ON_ABSORBTION_HPP_JOFA_100915
0010
0011 namespace boost{ namespace icl
0012 {
0013
0014 template<class Type, class Combiner, bool absorbs_identities>
0015 struct on_absorbtion;
0016
0017 template<class Type, class Combiner>
0018 struct on_absorbtion<Type, Combiner, false>
0019 {
0020 typedef on_absorbtion type;
0021 typedef typename Type::codomain_type codomain_type;
0022
0023 static bool is_absorbable(const codomain_type&){ return false; }
0024 };
0025
0026 template<class Type, class Combiner>
0027 struct on_absorbtion<Type, Combiner, true>
0028 {
0029 typedef on_absorbtion type;
0030 typedef typename Type::codomain_type codomain_type;
0031 typedef typename Type::codomain_combine codomain_combine;
0032
0033 static bool is_absorbable(const codomain_type& co_value)
0034 {
0035 return co_value == Combiner::identity_element();
0036 }
0037 };
0038
0039 }}
0040
0041 #endif
0042
0043