]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/icl/include/boost/icl/concept/map_value.hpp
bump version to 12.2.2-pve1
[ceph.git] / ceph / src / boost / libs / icl / include / boost / icl / concept / map_value.hpp
CommitLineData
7c673cae
FG
1/*-----------------------------------------------------------------------------+
2Copyright (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
10
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>
14
15namespace boost{ namespace icl
16{
17
18//==============================================================================
19//= AlgoUnifiers<Map>
20//==============================================================================
21template<class Type, class Iterator>
22inline typename enable_if<is_map<Type>, const typename Type::key_type>::type&
23key_value(Iterator it_)
24{
25 return (*it_).first;
26}
27
28template<class Type, class Iterator>
29inline typename enable_if<is_map<Type>, const typename Type::codomain_type>::type&
30co_value(Iterator it_)
31{
32 return (*it_).second;
33}
34
35template<class Type>
36inline typename enable_if<is_map<Type>, typename Type::value_type>::type
37make_value(const typename Type:: key_type& key_val,
38 const typename Type::codomain_type& co_val)
39{
40 return typename Type::value_type(key_val, co_val);
41}
42
43
44template <class Type>
45class content_is_identity_element: public property<Type>
46{
47public:
48 bool operator() (const Type& value_pair)const
49 {
50 return value_pair.second
51 == identity_element<typename Type::second_type>::value();
52 }
53} ;
54
55
56
57}} // namespace boost icl
58
59#endif
60
61