[C++-sig] [python] python + phoenix

troy d. straszheim troy at resophonic.com
Sat Oct 31 06:24:16 CET 2009


Ravi wrote:
> On Wednesday 14 October 2009 21:59:42 troy d. straszheim wrote:
>> 
>>    def("plus", as<int(int, int)>(arg1 + arg2));
>>
> 
> This is very cool and pretty intuitive. My main concern is that one needs to 
> build up the function type in generic code (as opposed to mpl vectors), but we 
> do have function_types to help us.

I take it that you have a use-case where it is difficult to specify

   as<R(A1,A2)>(thing)

and easy to specify

   as<mpl::vector<R, A1, A2> >(thing)

Could you elaborate?  I'm quite sure there is a way to provide (roughly) 
both interfaces:

   def("foo", as<int(double, string)>(functor()));

   def("foo", as<mpl::vector<int, double, std::string> >(functor()));

but I'm not sure I understand the problem.

> You are going to have to propose this as several small patched, 
 > before Ralf & Dave agree to it.

Shit.  I knew this would happen, I've written too much code again. 
Dave?   Ralf?

-t





More information about the Cplusplus-sig mailing list