[C++-sig] Pyplusplus: operators <</>> not supported?

Roman Yakovenko roman.yakovenko at gmail.com
Wed Jun 4 19:34:05 CEST 2008


On Wed, Jun 4, 2008 at 2:56 PM, Hans Meine
<meine at informatik.uni-hamburg.de> wrote:
> Am Mittwoch, 04. Juni 2008 12:31:08 schrieb Roman Yakovenko:
>> I found some definitions in MSDN for shift operators, but I didn't see
>> how I can redefine them for class.
>> Py++ has to distinct between shift and stream operators.
>
> BTW: currently I am using the following manual patch to add the operators:
>         .def( bp::self <<= bp::other< int >() )
> +        .def( bp::self << bp::other< int >() )
>         .def( bp::self == bp::self )
>         .def( bp::self >>= bp::other< int >() )
> +        .def( bp::self >> bp::other< int >() )
>
> (Obviously, this would better be done with an appropriate py++ script, but
> this is the first time I am using py++ and I do not yet know how this works.)


Can you send me link to the shift operator definition within a class?
It could be nice to see your class too.

Take a look on next link, it will help you to modify generated code via Py++:
http://language-binding.net/pyplusplus/documentation/inserting_code.html

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



More information about the Cplusplus-sig mailing list