[C++-sig] member operator ugly alias

Roman Yakovenko roman.yakovenko at gmail.com
Wed Jul 25 16:15:17 CEST 2007


On 7/25/07, Coockie_jr <achille.talon at gmail.com> wrote:
>
> Hi I'm getting some warnings with some of my operators just like this one.
>
> WARNING: bool NeoDate::operator>(NeoDate const & ts) const [member operator]
> > warning W1043: Py++ created an ugly alias ("operator_grate_") for
> > template instantiated class.
>
> Is there a way to avoid this "ugly alias".

Yes, you can change the alias:
http://language-binding.net/pyplusplus/documentation/apidocs/pyplusplus.decl_wrappers.decl_wrapper.decl_wrapper_t-class.html
Take a look on "rename" method or "alias" property

> And in a more general point of view is there a good way to deal with
> operators ?

When I developed this part of code generator, I missed this(
http://docs.python.org/ref/customization.html ) part of documentation.

I guess if you will give the right alias, than everything will work
"as expected".

All you need to do is to patch _get_alias method (
http://language-binding.net/pyplusplus/documentation/apidocs/pyplusplus.decl_wrappers.calldef_wrapper-pysrc.html#member_operator_t.__init__
) and send the patch to me :-)

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



More information about the Cplusplus-sig mailing list