00001 #ifndef QPID_PTR_MAP 00002 #define QPID_PTR_MAP 00003 00004 /* 00005 * 00006 * Licensed to the Apache Software Foundation (ASF) under one 00007 * or more contributor license agreements. See the NOTICE file 00008 * distributed with this work for additional information 00009 * regarding copyright ownership. The ASF licenses this file 00010 * to you under the Apache License, Version 2.0 (the 00011 * "License"); you may not use this file except in compliance 00012 * with the License. You may obtain a copy of the License at 00013 * 00014 * http://www.apache.org/licenses/LICENSE-2.0 00015 * 00016 * Unless required by applicable law or agreed to in writing, 00017 * software distributed under the License is distributed on an 00018 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 00019 * KIND, either express or implied. See the License for the 00020 * specific language governing permissions and limitations 00021 * under the License. 00022 * 00023 */ 00024 00025 #include <boost/ptr_container/ptr_map.hpp> 00026 #include <boost/version.hpp> 00027 00028 namespace qpid { 00029 namespace ptr_map { 00030 00043 #include <boost/type_traits/remove_const.hpp> 00044 00045 #if (BOOST_VERSION < 103400) 00046 00047 template <class PtrMapIter> 00048 typename PtrMapIter::pointer get_pointer(const PtrMapIter& i) 00049 { return &*i; } 00050 00051 #else 00052 00053 template <class PtrMapIter> 00054 typename boost::remove_const<typename PtrMapIter::value_type::second_type>::type 00055 get_pointer(const PtrMapIter& i) 00056 { return i->second; } 00057 00058 #endif 00059 00060 }} // namespace qpid::ptr_map 00061 00062 #endif 00063 #ifndef QPID_PTR_MAP 00064 #define QPID_PTR_MAP 00065 00066 /* 00067 * 00068 * Licensed to the Apache Software Foundation (ASF) under one 00069 * or more contributor license agreements. See the NOTICE file 00070 * distributed with this work for additional information 00071 * regarding copyright ownership. The ASF licenses this file 00072 * to you under the Apache License, Version 2.0 (the 00073 * "License"); you may not use this file except in compliance 00074 * with the License. You may obtain a copy of the License at 00075 * 00076 * http://www.apache.org/licenses/LICENSE-2.0 00077 * 00078 * Unless required by applicable law or agreed to in writing, 00079 * software distributed under the License is distributed on an 00080 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 00081 * KIND, either express or implied. See the License for the 00082 * specific language governing permissions and limitations 00083 * under the License. 00084 * 00085 */ 00086 00087 #include <boost/ptr_container/ptr_map.hpp> 00088 #include <boost/version.hpp> 00089 00090 namespace qpid { 00091 namespace ptr_map { 00092 00104 #if (BOOST_VERSION < 103400) 00105 00106 template <class PtrMapIter> 00107 typename PtrMapIter::pointer get_pointer(const PtrMapIter& i) 00108 { return &*i; } 00109 00110 #else 00111 00112 template <class PtrMapIter> 00113 typename PtrMapIter::value_type::second_type get_pointer(const PtrMapIter& i) 00114 { return i->second; } 00115 00116 #endif 00117 00118 }} // namespace qpid::ptr_map 00119 00120 #endif