File indexing completed on 2025-01-18 09:29:37
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_IDENTITY_CONVERTERS_HPP
0013 #define BOOST_BIMAP_CONTAINER_ADAPTOR_DETAIL_IDENTITY_CONVERTERS_HPP
0014
0015 #if defined(_MSC_VER)
0016 #pragma once
0017 #endif
0018
0019 #include <boost/config.hpp>
0020
0021 namespace boost {
0022 namespace bimaps {
0023 namespace container_adaptor {
0024
0025
0026
0027 namespace detail {
0028
0029
0030
0031
0032
0033
0034
0035 template
0036 <
0037 class BaseIterator , class Iterator,
0038 class BaseConstIterator , class ConstIterator
0039 >
0040 struct iterator_to_base_identity
0041 {
0042 BaseIterator operator()(Iterator iter) const
0043 {
0044 return BaseIterator(iter);
0045 }
0046
0047 BaseConstIterator operator()(ConstIterator iter) const
0048 {
0049 return BaseConstIterator(iter);
0050 }
0051 };
0052
0053 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
0054
0055 template< class BaseIterator, class Iterator >
0056 struct iterator_to_base_identity<BaseIterator,Iterator,BaseIterator,Iterator>
0057 {
0058 BaseIterator operator()(Iterator iter) const
0059 {
0060 return BaseIterator(iter);
0061 }
0062 };
0063
0064 #endif
0065
0066
0067
0068
0069
0070
0071
0072 template
0073 <
0074 class BaseIterator , class Iterator,
0075 class BaseConstIterator , class ConstIterator
0076 >
0077 struct iterator_from_base_identity
0078 {
0079 Iterator operator()(BaseIterator iter) const
0080 {
0081 return Iterator(iter);
0082 }
0083 ConstIterator operator()(BaseConstIterator iter) const
0084 {
0085 return ConstIterator(iter);
0086 }
0087 };
0088
0089 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
0090
0091 template< class BaseIterator, class Iterator, class ConstIterator >
0092 struct iterator_from_base_identity<BaseIterator,Iterator,BaseIterator,ConstIterator>
0093 {
0094 Iterator operator()(BaseIterator iter) const
0095 {
0096 return Iterator(iter);
0097 }
0098 };
0099
0100 #endif
0101
0102
0103
0104 template< class BaseValue, class Value >
0105 struct value_to_base_identity
0106 {
0107 BaseValue operator()(const Value & val) const
0108 {
0109 return BaseValue(val);
0110 }
0111 };
0112
0113 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
0114
0115 template< class Value >
0116 struct value_to_base_identity< Value, Value >
0117 {
0118 const Value & operator()(const Value & val) const
0119 {
0120 return val;
0121 }
0122 };
0123
0124 #endif
0125
0126
0127
0128 template< class BaseValue, class Value >
0129 struct value_from_base_identity
0130 {
0131 Value operator()(const BaseValue & val) const
0132 {
0133 return Value(val);
0134 }
0135 };
0136
0137 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
0138
0139 template< class Value >
0140 struct value_from_base_identity<Value,Value>
0141 {
0142 Value & operator()(Value & val) const
0143 {
0144 return val;
0145 }
0146
0147 const Value & operator()(const Value & val) const
0148 {
0149 return val;
0150 }
0151 };
0152
0153 #endif
0154
0155
0156
0157 template< class BaseKey, class Key >
0158 struct key_to_base_identity
0159 {
0160 BaseKey operator()(const Key & k) const
0161 {
0162 return BaseKey(k);
0163 }
0164 };
0165
0166 #ifndef BOOST_BIMAP_DOXYGEN_WILL_NOT_PROCESS_THE_FOLLOWING_LINES
0167
0168 template< class Key >
0169 struct key_to_base_identity< Key, Key >
0170 {
0171
0172
0173
0174 template< class CompatibleKey >
0175 const CompatibleKey & operator()(const CompatibleKey & k) const
0176 {
0177 return k;
0178 }
0179 };
0180
0181 #endif
0182
0183 }
0184 }
0185 }
0186 }
0187
0188
0189 #endif
0190
0191