[C++-sig] Re: Re: Callable object instance as object method.

Kerim Borchaev warkid at hotbox.ru
Fri Aug 15 10:31:28 CEST 2003


Hello!

Dave Abrahams wrote:

>> Is it possible to export it in such a way that C().method whould
>> result in bound method object?
> 
> There's no really easy way yet, but I intend to create one.  In the
> meantime, you could try simply:
> 
>           class<C>("C")
>               .setattr(
>                     "method"
>                   , detail::make_function_aux(
>                        Callable()
>                      , default_call_policies()
>                      , detail::args_from_python()
>                      , mpl::vector<void,C&>())
>               )
>           ;

Yes it works(assuming Callable has operator()). Thanks.

Best regards,
 Kerim                          mailto:warkid at hotbox.ru






More information about the Cplusplus-sig mailing list