Boost logo

Boost :

From: rwgk_at_[hidden]
Date: 2001-07-16 21:54:26


--- In boost_at_y..., "David Abrahams" <david.abrahams_at_r...> wrote:
> Hi Ralf,
>
> I'm not sure. I think you'd need some funky metaprogramming.
Actually, on
> second thought, I don't see how to get it to work anymore - the
default
> argument values can only be generated by code which tries to call
the
> function directly AFAICT. I think Ulli and I discussed it long ago;
maybe he
> remembers an approach.

Wouldn't it be possible to use something like the constructor<>
template to generate signatures? For example:

struct hello {
  //..
  int foo(int i, bool b = false);
};

py_hello.def(boost::python::signature<int>, &hello::foo, "foo");
py_hello.def(boost::python::signature<int, bool>, &hello::foo, "foo");

Doesn't this look like something that would be easy to implement?

Ralf


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk