File indexing completed on 2025-01-18 09:51:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef BOOST_RANGE_ADAPTOR_MFC_MAP_HPP
0012 #define BOOST_RANGE_ADAPTOR_MFC_MAP_HPP
0013
0014 #if !defined(BOOST_RANGE_MFC_NO_CPAIR)
0015
0016 #include <boost/range/mfc.hpp>
0017 #include <boost/range/adaptor/map.hpp>
0018
0019 namespace boost
0020 {
0021 namespace range_detail
0022 {
0023
0024
0025
0026
0027
0028
0029
0030
0031
0032
0033 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
0034 struct select_first< CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> >
0035 {
0036 typedef BOOST_DEDUCED_TYPENAME CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> map_type;
0037 typedef BOOST_DEDUCED_TYPENAME range_reference<const map_type>::type argument_type;
0038 typedef BOOST_DEDUCED_TYPENAME const KEY& result_type;
0039
0040 result_type operator()( argument_type r ) const
0041 {
0042 return r.key;
0043 }
0044 };
0045
0046 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
0047 struct select_second_mutable< CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> >
0048 {
0049 typedef BOOST_DEDUCED_TYPENAME CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> map_type;
0050 typedef BOOST_DEDUCED_TYPENAME range_reference<map_type>::type argument_type;
0051 typedef BOOST_DEDUCED_TYPENAME VALUE& result_type;
0052
0053 result_type operator()( argument_type r ) const
0054 {
0055 return r.value;
0056 }
0057 };
0058
0059 template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
0060 struct select_second_const< CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> >
0061 {
0062 typedef BOOST_DEDUCED_TYPENAME CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> map_type;
0063 typedef BOOST_DEDUCED_TYPENAME range_reference<const map_type>::type argument_type;
0064 typedef BOOST_DEDUCED_TYPENAME const VALUE& result_type;
0065
0066 result_type operator()( argument_type r ) const
0067 {
0068 return r.value;
0069 }
0070 };
0071
0072
0073
0074 template<>
0075 struct select_first< CMapStringToString >
0076 {
0077 typedef range_reference<const CMapStringToString>::type argument_type;
0078 typedef const CString& result_type;
0079
0080 result_type operator()( argument_type r ) const
0081 {
0082 return r.key;
0083 }
0084 };
0085
0086 template<>
0087 struct select_second_mutable< CMapStringToString >
0088 {
0089 typedef range_reference<CMapStringToString>::type argument_type;
0090 typedef CString& result_type;
0091
0092 result_type operator()( argument_type r ) const
0093 {
0094 return r.value;
0095 }
0096 };
0097
0098 template<>
0099 struct select_second_const< CMapStringToString >
0100 {
0101 typedef range_reference<const CMapStringToString>::type argument_type;
0102 typedef const CString& result_type;
0103
0104 result_type operator()( argument_type r ) const
0105 {
0106 return r.value;
0107 }
0108 };
0109 }
0110 }
0111
0112 #endif
0113
0114 #endif