From cfb13fad22007697d7773085c47c8b9f24a261db Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Tue, 19 Aug 2003 03:28:53 +0000 Subject: [PATCH] fix for wrapping vector [SVN r19692] --- .../boost/python/suite/indexing/vector_indexing_suite.hpp | 7 ++++++- test/vector_indexing_suite.cpp | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/include/boost/python/suite/indexing/vector_indexing_suite.hpp b/include/boost/python/suite/indexing/vector_indexing_suite.hpp index 5c575828..b6290038 100644 --- a/include/boost/python/suite/indexing/vector_indexing_suite.hpp +++ b/include/boost/python/suite/indexing/vector_indexing_suite.hpp @@ -67,7 +67,12 @@ namespace boost { namespace python { ; } - static data_type& + static + typename mpl::if_< + is_class + , data_type& + , data_type + >::type get_item(Container& container, index_type i) { return container[i]; diff --git a/test/vector_indexing_suite.cpp b/test/vector_indexing_suite.cpp index c5b8eada..07fc5e91 100644 --- a/test/vector_indexing_suite.cpp +++ b/test/vector_indexing_suite.cpp @@ -44,5 +44,10 @@ BOOST_PYTHON_MODULE(vector_indexing_suite_ext) class_ >("FloatVec") .def(vector_indexing_suite >()) ; + + // Compile check only... + class_ >("BoolVec") + .def(vector_indexing_suite >()) + ; }