[C++-sig] Py++ and protected destructors

Roman Yakovenko roman.yakovenko at gmail.com
Thu Sep 17 12:43:00 CEST 2009


2009/9/17 Pertti Kellomäki <pertti.kellomaki at tut.fi>:
> Roman Yakovenko wrote:
>>
>> Okey. You should use "modify_type" function transformation with
>> "remove_const" type traits function.
>
> Thanks. This does not quite solve the problem, as remove_const
> will turn "const A" to "A" but leave "A const &" as it is.

Right, I forgot about that. Actually the type composition looks like:
ref( const( A ) )

> I modified remove_const to convert "A const &" to "A &" and it is
> only a few lines. However, I'm not sure whether this really is the
> semantics you want for remove const. Maybe I should create my own
> function remove_const_ref and use that as a transformation instead?

Yes you should create and pass your own function.

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/


More information about the Cplusplus-sig mailing list