[C++-sig] "pass all args in list" syntax

Gennadiy Rozental rogeeff at gmail.com
Fri Oct 9 08:25:26 CEST 2009


Hi,

In native Python  I can do something like this:

    def goo(a,b,c):
        return a+b+c

    ll = [1,2,3]
    goo( *ll )

And it will pass all the arguments properly. I need similar functionality in C++:

Given 

bp::object func;
bp::list args;

I'd like to invoke the function like this func( *args );

Is there syntax in Boost.Python to achieve this? Or I need to resort to ugly
switch statement?

Gennadiy



More information about the Cplusplus-sig mailing list