[C++-sig] Re: call_method

David Abrahams dave at boost-consulting.com
Wed Dec 4 15:50:54 CET 2002


Brett Calcott <brett.calcott at paradise.net.nz> writes:

>> Not implemented yet:
>> 
>> * Automatic conversion of shared_ptr<T> to python (e.g. when used as a
>>   return type). For that, you still need to pass shared_ptr<T> to
>>   class_<...> as the holder, and since the old mechanism doesn't take
>>   advantage of the new shared_ptr deleter introspection feature yet,
>>   you always get a new Python object.
>
> You could roll your own for the moment with a ustom to_python convertor
> - right?

Right.

>> Open questions:
>> 
>> * There is some cost in code and compilation time associated with
>>   these automatic conversions for each class_<...> instance. Should
>>   users really be forced to pay for these conversions, or should they
>>   be explicitly requested, e.g.
>> 
>>      register_shared_ptr<T>();
>> 
>>   Such a function may be needed anyway, since classes that are exposed
>>   other than via class_<> (see, e.g. class Simple in
>>   libs/python/test/m1.cpp) may want to be managed via shared_ptr<>.
>
> Anything to ease the strain on our poor compilers would be good :) 
> Of course, I'll be using it all the time.

If a guy who says he's going to use it all the time volunteers to have
it be manual, I guess I'm sold on the idea that it should be manual.

Do I hear any further objections?

> Thanks for the new funkiness.

Sure!

bootsy-ly y'rs,
dave
-- 
                       David Abrahams
   dave at boost-consulting.com * http://www.boost-consulting.com
Boost support, enhancements, training, and commercial distribution





More information about the Cplusplus-sig mailing list