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

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Mon Nov 18 19:50:31 CET 2002

--- Kerim Borchaev <warkid at hotbox.ru> wrote:
> 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) ?

IIUC, the information about the size is ignored by the compiler. Your
declaration is equivalent to void f(float*). But you can use a thin wrapper
with a boost::array<float, 16> const& in the signature, in combination with the
scitbx container conversion header (which has no dependencies other than
Boost.Python V2).

Here is the header:


Here is a regression test/example:


Look for, e.g. boost_array_3 and

      boost::array<double, 3>,


Do you Yahoo!?
Yahoo! Web Hosting - Let the expert host your site

More information about the Cplusplus-sig mailing list