Menu

#31 FT.modify_type ignores implicit conversion

open
nobody
None
5
2011-10-11
2011-10-11
No

pyplusplus.function_transformers.modify_type uses reinterpret_cast even when the old type has an implicit constructor that takes an argument of the new type.

The documentation states that 'If implicit conversion between new type and the old one does not exist “reinterpret_cast” will be used.' What does 'implicit conversion exists' mean if not a constructor with the signature <old-type>::<old-type>(<new-type> const&)?

I can understand how Py++ would be unable to detect the existence of an implicit conversion if <old-type> was forward-declared but in this case <old-type>'s header is directly included in the header for the class for which bindings are being generated.

This bug was found in revision 1856.

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.