File indexing completed on 2025-01-18 09:38:19
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef BOOST_ICL_CONCEPT_MAP_VALUE_HPP_JOFA_100924
0009 #define BOOST_ICL_CONCEPT_MAP_VALUE_HPP_JOFA_100924
0010
0011 #include <boost/icl/type_traits/predicate.hpp>
0012 #include <boost/icl/type_traits/identity_element.hpp>
0013 #include <boost/icl/type_traits/is_map.hpp>
0014
0015 namespace boost{ namespace icl
0016 {
0017
0018
0019
0020
0021 template<class Type, class Iterator>
0022 inline typename enable_if<is_map<Type>, const typename Type::key_type>::type&
0023 key_value(Iterator it_)
0024 {
0025 return (*it_).first;
0026 }
0027
0028 template<class Type, class Iterator>
0029 inline typename enable_if<is_map<Type>, const typename Type::codomain_type>::type&
0030 co_value(Iterator it_)
0031 {
0032 return (*it_).second;
0033 }
0034
0035 template<class Type>
0036 inline typename enable_if<is_map<Type>, typename Type::value_type>::type
0037 make_value(const typename Type:: key_type& key_val,
0038 const typename Type::codomain_type& co_val)
0039 {
0040 return typename Type::value_type(key_val, co_val);
0041 }
0042
0043
0044 template <class Type>
0045 class content_is_identity_element: public property<Type>
0046 {
0047 public:
0048 bool operator() (const Type& value_pair)const
0049 {
0050 return value_pair.second
0051 == identity_element<typename Type::second_type>::value();
0052 }
0053 } ;
0054
0055
0056
0057 }}
0058
0059 #endif
0060
0061