123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- #ifndef BOOST_RANGE_ADAPTOR_MFC_MAP_HPP
- #define BOOST_RANGE_ADAPTOR_MFC_MAP_HPP
- #if !defined(BOOST_RANGE_MFC_NO_CPAIR)
- #include <boost/range/mfc.hpp>
- #include <boost/range/adaptor/map.hpp>
- namespace boost
- {
- namespace range_detail
- {
-
-
-
-
-
-
-
-
-
-
- template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
- struct select_first< CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> >
- {
- typedef BOOST_DEDUCED_TYPENAME CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> map_type;
- typedef BOOST_DEDUCED_TYPENAME range_reference<const map_type>::type argument_type;
- typedef BOOST_DEDUCED_TYPENAME const KEY& result_type;
- result_type operator()( argument_type r ) const
- {
- return r.key;
- }
- };
- template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
- struct select_second_mutable< CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> >
- {
- typedef BOOST_DEDUCED_TYPENAME CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> map_type;
- typedef BOOST_DEDUCED_TYPENAME range_reference<map_type>::type argument_type;
- typedef BOOST_DEDUCED_TYPENAME VALUE& result_type;
- result_type operator()( argument_type r ) const
- {
- return r.value;
- }
- };
- template<class KEY, class ARG_KEY, class VALUE, class ARG_VALUE>
- struct select_second_const< CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> >
- {
- typedef BOOST_DEDUCED_TYPENAME CMap<KEY, ARG_KEY, VALUE, ARG_VALUE> map_type;
- typedef BOOST_DEDUCED_TYPENAME range_reference<const map_type>::type argument_type;
- typedef BOOST_DEDUCED_TYPENAME const VALUE& result_type;
- result_type operator()( argument_type r ) const
- {
- return r.value;
- }
- };
-
- template<>
- struct select_first< CMapStringToString >
- {
- typedef range_reference<const CMapStringToString>::type argument_type;
- typedef const CString& result_type;
- result_type operator()( argument_type r ) const
- {
- return r.key;
- }
- };
- template<>
- struct select_second_mutable< CMapStringToString >
- {
- typedef range_reference<CMapStringToString>::type argument_type;
- typedef CString& result_type;
- result_type operator()( argument_type r ) const
- {
- return r.value;
- }
- };
- template<>
- struct select_second_const< CMapStringToString >
- {
- typedef range_reference<const CMapStringToString>::type argument_type;
- typedef const CString& result_type;
- result_type operator()( argument_type r ) const
- {
- return r.value;
- }
- };
- }
- }
- #endif
- #endif
|