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
00029 namespace qpid {
00030
00044 typedef boost::is_same<boost::ptr_map<int, int>::iterator::value_type,
00045 int> IsOldPtrMap;
00046
00047 template <class Iter>
00048 typename boost::enable_if<IsOldPtrMap, typename Iter::value_type*>::type
00049 ptr_map_ptr(const Iter& i) { return &*i; }
00050
00051 template <class Iter>
00052 typename boost::disable_if<IsOldPtrMap, typename Iter::value_type::second_type>::type
00053 ptr_map_ptr(const Iter& i) { return i->second; }
00054
00055 }
00056
00057 #endif