[C++-sig] Call policies choice

Coockie_jr achille.talon at gmail.com
Tue Jul 31 11:45:56 CEST 2007



Roman Yakovenko wrote:
> 
> On 7/31/07, Coockie_jr <achille.talon at gmail.com> wrote:
>>
>> Hi I'l still working on trying to wrap a library with boost.python an
>> py++
>> but I'm having some difficulties with call policies and a little hint
>> would
>> be nice since the on-line documentation doesn't help me much (or I just
>> don't understand ;) )
> 
> Did you read this:
> http://boost.org/libs/python/doc/tutorial/doc/html/python/functions.html#python.call_policies
> ?
> 
> Actually I did and it was quite helpful.
> 
> 
>> I've got this classe
>>
>> class NeoCollection:public NeoMsgType{
>> public:
>> ...
>> ...
>>         virtual NeoMsgType* get(unsigned short index) const= 0;
>> ...
>> ...
>>         virtual string toString() const;
>> protected:
>>         unsigned short count;
>> };
> 
> To get good answer you should define who is the owner of the returned
> object?
> If it is the NeoCollection instance than "return_internal_reference"
> should be used.
> 
> That is also what I thought but I get this error when using bjam.
> 
> D:\boost_1_34_0\boost/python/detail/caller.hpp(199) : error C2027: use of
> undefined type
> 'pyplusplus::call_policies::detail::return_pointee_value_requires_a_pointer_return_type<R>
> 
> Full bjam log here (with some French but not that much ...)
> http://coockiejrdepot.free.fr/Stage/log_bjam.txt
> 
> In fact it looks more like an issue that isn't directly linked with the
> choice of the call policy.
> 
>> And boost requires specific call policies get and toString methods.
> 
> What do you try to say?
> 
> Hmm It seems I fell asleep when typing this sentence. I edited it.
> 
> -- 
> Roman Yakovenko
> C++ Python language binding
> http://www.language-binding.net/
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig
> 
> 

-- 
View this message in context: http://www.nabble.com/-C%2B%2B-sig--Call-policies-choice-tf4191655.html#a11921152
Sent from the Python - c++-sig mailing list archive at Nabble.com.




More information about the Cplusplus-sig mailing list