[BGL-Python] __len__ and __iter__ for property maps

I'm trying to build BGL-Python from SVN. I managed to build it successfully on Windows (VC 8.0) but I'm having problems with gcc 3.4 on Linux; although it does compile, it doesn't expose in Python two property map methods, __len__ and __iter__. I think I narrowed it down to the non-selection of a template specialization: // boost/graph/python/property_map.hpp namespace boost { namespace graph { namespace python { namespace detail { / * skip other stuff */ template<typename Class, typename T, typename IndexMap> void property_map_extras(Class& pm, type<vector_property_map<T, IndexMap> >) { pm.def("__len__", &py_vector_property_map_length<T, IndexMap>); typedef typename std::vector<T>::iterator value_iterator; simple_python_iterator<value_iterator>::declare("ValueIterator"); pm.def("__iter__", &py_vector_property_map_values<T, IndexMap>); } template<typename Class, typename PropertyMap> inline void property_map_extras(Class&, type<PropertyMap>) { } } // end namespace detail */ So for __len__ and __iter__ to be included, the first overloading of property_map_extras must be called. That's what happens with VC 8.0 (in fact I can remove the second empty function and compiles just fine), but gcc selects the second one. Can anyone help and/or reproduce it ? Thanks, George

On Feb 23, 2007, at 10:42 AM, George Sakkis wrote:
I'm trying to build BGL-Python from SVN. I managed to build it successfully on Windows (VC 8.0) but I'm having problems with gcc 3.4 on Linux; although it does compile, it doesn't expose in Python two property map methods, __len__ and __iter__.
Thanks for tracking this down. I've now (*finally*) put a fix into Subversion. - Doug
participants (2)
-
Doug Gregor
-
George Sakkis