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