00001 #ifndef QPID_PTR_MAP
00002 #define QPID_PTR_MAP
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #include <boost/ptr_container/ptr_map.hpp>
00026 #include <boost/utility/enable_if.hpp>
00027 #include <boost/type_traits/is_same.hpp>
00028 #include <boost/type_traits/remove_const.hpp>
00029
00030 namespace qpid {
00031
00043 typedef boost::is_same<boost::ptr_map<int, int>::iterator::value_type, int> IsOldPtrMap;
00044
00045 template <class Iter>
00046 typename boost::enable_if<IsOldPtrMap, typename Iter::value_type*>::type
00047 ptr_map_ptr(const Iter& i) { return &*i; }
00048
00049 template <class Iter>
00050 typename boost::disable_if<IsOldPtrMap,
00051 typename boost::remove_const<typename Iter::value_type::second_type>::type
00052 >::type
00053 ptr_map_ptr(const Iter& i) { return i->second; }
00054
00055 }
00056
00057 #endif