[C++-sig] Overloaded [] operator

Nick Rasmussen nick at ilm.com
Tue Jul 19 02:25:10 CEST 2005


you can overload "__getitem__" and "__setitem__" for the [] operator.

-nick

On Mon, 18 Jul 2005, Ram, Siddharth wrote:

> I have a C++ class which defines the following method:
> 
> CORBA::Octet &operator[] (CORBA::ULong);
> 
> I am trying to figure out how to export this to python using
> pyste/Boost.Python.
> http://www.boost.org/libs/python/doc/v2/operators.html does not include
> the square bracket operator in the list of operators. Is this not a
> supported operation ? How do I specify a  python method which would
> result in this method being invoked in C++ ?
> 
> Thanks
> Siddharth
> _______________________________________________
> C++-sig mailing list
> C++-sig at python.org
> http://mail.python.org/mailman/listinfo/c++-sig




More information about the Cplusplus-sig mailing list