[C++-sig] Passing C++ arrays as arguments

Kerim Borchaev warkid at hotbox.ru
Mon Nov 18 18:11:58 CET 2002


Hello.

I'm exposing to Python some third party library wich has an API like
this:

struct Abstract{
    virtual void f(float[16])=0;
};

Abstract *createInstance();

with this code:

def("createInstance", createInstance, return_value_policy<manage_new_object>());
class_<Abstract, boost::noncopyable>("Abstract", no_init)
    .def("f", Abstract::f);

Can I simply define some from python tuple to float[16] converter so
that I can call object returned from createInstance like this:
createInstance().f((0,)*16) ?

Best regards,
 Kerim                          mailto:warkid at hotbox.ru






More information about the Cplusplus-sig mailing list