[C++-sig] Boost.Python queries

David Abrahams david.abrahams at rcn.com
Tue Jan 29 23:56:23 CET 2002


----- Original Message -----
From: "Hugo van der Merwe" <s13361562 at bach.sun.ac.za>

>
> So is it easy for me to push this limit up to 8? Or should I try
> grouping my returned tuples like so:
>
> ( (x,y,z), (a,b), (f,g), k) ?


For now, the easiest thing to do is to initialize your tuple with its
length, then call set_item repeatedly to initialize the elements:

tuple t(8);
t.set_item(0, make_ref(x));
t.set_item(1, make_ref(y));
...


> > > Exceptions: I checked the examples - they show nicely how to raise an
> > > exception in your wrapper code. Is there a way to have exceptions that
> > > are raised in the wrapped code automatically converted though?
> >
> > Not yet. You can derive your exceptions from std::exception, as
described in
> > http://groups.yahoo.com/group/boost/message/17910, but that doesn't
produce
> > very nice results.
>
> Thanks. I'll take a look.
>
> Boost.Python truly is great to work with, thanks!

Glad you like it!

-Dave






More information about the Cplusplus-sig mailing list