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_CONCEPT_MAP_VALUE_HPP_JOFA_100924
9 #define BOOST_ICL_CONCEPT_MAP_VALUE_HPP_JOFA_100924
11 #include <boost/icl/type_traits/predicate.hpp>
12 #include <boost/icl/type_traits/identity_element.hpp>
13 #include <boost/icl/type_traits/is_map.hpp>
15 namespace boost{ namespace icl
18 //==============================================================================
20 //==============================================================================
21 template<class Type, class Iterator>
22 inline typename enable_if<is_map<Type>, const typename Type::key_type>::type&
23 key_value(Iterator it_)
28 template<class Type, class Iterator>
29 inline typename enable_if<is_map<Type>, const typename Type::codomain_type>::type&
30 co_value(Iterator it_)
36 inline typename enable_if<is_map<Type>, typename Type::value_type>::type
37 make_value(const typename Type:: key_type& key_val,
38 const typename Type::codomain_type& co_val)
40 return typename Type::value_type(key_val, co_val);
45 class content_is_identity_element: public property<Type>
48 bool operator() (const Type& value_pair)const
50 return value_pair.second
51 == identity_element<typename Type::second_type>::value();
57 }} // namespace boost icl