[C++-sig] ArgumentError...

David Abrahams dave at boost-consulting.com
Mon Jun 19 23:35:55 CEST 2006

"Cyril Bazin" <cyril.bazin at info.unicaen.fr> writes:

> But when I call the method "finite_vertices", I get the following error :
> Traceback (most recent call last):
>   File "testPygale.py", line 40, in test_delaunay_2
>     it = d.finite_vertices()
> ArgumentError: Python argument types in
>     Delaunay.finite_vertices(Delaunay)
> did not match C++ signature:
> finite_vertices(boost::python::back_reference<CGAL::Triangulation_2<CGAL::Cartesian<double>,
> CGAL::Tds2<CGAL::Tvb<CGAL::Cartesian<double>, CGAL::Tdsvb<void> >,
> CGAL::Tdsfb<void> > >&>)
> If you can help me to solve this error, please...

My best guess is that Delaunay is derived from 

     , CGAL::Tds2<
           CGAL::Tvb<CGAL::Cartesian<double>, CGAL::Tdsvb<void> >
         , CGAL::Tdsfb<void> 

which supplies finite_vertices_begin and finite_vertices_end.  Since
you haven't wrapped that, and Boost.Python doesn't know it's a base
class of Delaunay, you get the error.  

You have two choices:

1. pre-assign finite_vertices_end/begin to variables (or cast to
   temporaries) of type 

      Finite_vertices_iterator (Delaunay::*)()

   and pass those to range(...)

2. Use the first form of range<NextPolicies,Target>(...) described
   here: http://boost.org/libs/python/doc/v2/iterator.html#range-spec


Dave Abrahams
Boost Consulting

More information about the Cplusplus-sig mailing list