Skip to content

Commit cfb13fa

Browse files
committed
fix for wrapping vector<bool>
[SVN r19692]
1 parent 4e3f3a0 commit cfb13fa

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,12 @@ namespace boost { namespace python {
6767
;
6868
}
6969

70-
static data_type&
70+
static
71+
typename mpl::if_<
72+
is_class<data_type>
73+
, data_type&
74+
, data_type
75+
>::type
7176
get_item(Container& container, index_type i)
7277
{
7378
return container[i];

test/vector_indexing_suite.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,10 @@ BOOST_PYTHON_MODULE(vector_indexing_suite_ext)
4444
class_<std::vector<float> >("FloatVec")
4545
.def(vector_indexing_suite<std::vector<float> >())
4646
;
47+
48+
// Compile check only...
49+
class_<std::vector<bool> >("BoolVec")
50+
.def(vector_indexing_suite<std::vector<bool> >())
51+
;
4752
}
4853

0 commit comments

Comments
 (0)