Boost logo

Boost :

From: Ullrich Koethe (u.koethe_at_[hidden])
Date: 2001-07-17 04:39:33


Hi all,

IIRC, I proposed a syntax like the following:

module.def(&foo, "foo", default_args<2>());

This function would instantiate "foo" with 2 default arguments used, and
then call

   def(&foo, "foo", default_args<1>());

This in turn instantiates "foo" with 1 default argument and then calls
   
   def(&foo, "foo");

to instantiate "foo" normally and end the recursion. However, I cannot
remember whether this approach required a new function class - I'll have
a look.

Regards
Ulli

> ----- Original Message -----
> From: <rwgk_at_[hidden]>
> To: <boost_at_[hidden]>
> Sent: Monday, July 16, 2001 1:58 PM
> Subject: [boost] Re: Boost:::python default function arguments
>
> > --- In boost_at_y..., "David Abrahams" <david.abrahams_at_r...> wrote:
> > > If someone was interested in adding this feature, it would be
> > possible to
> > > provide a different def() function overload which takes as a
> > parameter the
> > > number of default arguments and generates all of the neccessary
> > Python
> > > function overloads.
> > >
> > > -Dave
> >
> > I am! My Boost.Python module code is full of manually
> > generated overloads for member functions with default
> > arguments.
> >
> > David, how difficult is it to implement your suggestion?
> >
> 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.

-- 
 ________________________________________________________________
|                                                                |
| Ullrich Koethe  Universität Hamburg / University of Hamburg    |
|                 FB Informatik / Dept. of Computer Science      |
|                 AB Kognitive Systeme / Cognitive Systems Group |
|                                                                |
| Phone: +49 (0)40 42883-2573                Vogt-Koelln-Str. 30 |
| Fax:   +49 (0)40 42883-2572                D - 22527 Hamburg   |
| Email: u.koethe_at_[hidden]               Germany             |
|        koethe_at_[hidden]                        |
| WWW:   http://kogs-www.informatik.uni-hamburg.de/~koethe/      |
|________________________________________________________________|

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