Skip to content

Commit 4946af1

Browse files
committed
Map indexing fix for VC6.5
[SVN r19699]
1 parent 9959dcf commit 4946af1

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

include/boost/python/suite/indexing/indexing_suite.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# define INDEXING_SUITE_JDG20036_HPP
99

1010
# include <boost/python/class.hpp>
11+
# include <boost/python/def_visitor.hpp>
1112
# include <boost/python/register_ptr_to_python.hpp>
1213
# include <boost/python/suite/indexing/detail/indexing_suite_detail.hpp>
1314
# include <boost/python/return_internal_reference.hpp>

include/boost/python/suite/indexing/map_indexing_suite.hpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@ namespace boost { namespace python {
5353
, DerivedPolicies
5454
, NoProxy
5555
, true
56-
, typename Container::mapped_type
56+
, typename Container::value_type::second_type
5757
, typename Container::key_type
5858
, typename Container::key_type
5959
>
6060
{
6161
public:
6262

63-
typedef typename Container::mapped_type data_type;
63+
typedef typename Container::value_type value_type;
64+
typedef typename Container::value_type::second_type data_type;
6465
typedef typename Container::key_type key_type;
6566
typedef typename Container::key_type index_type;
6667
typedef typename Container::size_type size_type;
@@ -76,12 +77,12 @@ namespace boost { namespace python {
7677
elem_name += "_entry";
7778

7879
typedef typename mpl::if_<
79-
is_class<typename Container::mapped_type>
80+
is_class<data_type>
8081
, return_internal_reference<>
8182
, default_call_policies
8283
>::type get_data_return_policy;
8384

84-
class_<typename Container::value_type>(elem_name.c_str())
85+
class_<value_type>(elem_name.c_str())
8586
.def("__repr__", &DerivedPolicies::print_elem)
8687
.def("data", &DerivedPolicies::get_data, get_data_return_policy())
8788
.def("key", &DerivedPolicies::get_key)
@@ -96,9 +97,9 @@ namespace boost { namespace python {
9697

9798
static
9899
typename mpl::if_<
99-
is_class<typename Container::mapped_type>
100-
, typename Container::mapped_type&
101-
, typename Container::mapped_type
100+
is_class<data_type>
101+
, data_type&
102+
, data_type
102103
>::type
103104
get_data(typename Container::value_type& e)
104105
{

0 commit comments

Comments
 (0)