[C++-sig] CallPolicy for operators
Michael Wild
themiwi at users.sourceforge.net
Sun Jan 27 11:02:05 CET 2013
Hi all
Is there a way to apply a CallPolicy to operator definitions? In
particular, I'm interested in the inplace operators (+=, -=, *=, /= and
friends).
To give a bit more context: The library I'm trying to wrap exposes some
static const objects. So far, I have been able to wrap modifying
function by having a registration facility for these static const
objects and a custom CallPolicy that raises an AttributError when one
tries to modify one of the registered objects.
One option I see is to directly define __iadd__ etc. instead of using
the built-in convenience operators. However, I'm not sure whether that
has unintended side-effects. I haven't completely understood the
operators implementation in bp, but it looks fairly involved.
Thanks
Michael
More information about the Cplusplus-sig
mailing list