Dag Sverre Seljebotn wrote:

> (Note that C++ overloading on return type in the specific case of the 
> conversion operator, "operator SomeType". I.e. you can have "int a = x; 
> float b = x" invoke two different methods on an x object to do the 
> conversion.)

But that's not overloading on return type -- it's not
even overloading at all, since they're different
methods.

Overloading on return type would be if

   int a = x.foo()

and

   float b = x.foo()

were to select different versions of the foo() method
based on their return types. I don't think C++ does
that (although I might be wrong).

> Summary:
>  - C++ does *only* have "getitem", not "setitem".

It's more accurate to say that it has neither "getitem"
nor "setitem", but rather a single "get reference to item",
the result of which can be used as either an lvalue or
an rvalue (or at least it's possible to define an operator[]
that works that way).

All of these complications are part of the reason I've
been very cautious about adding C++ features to Pyrex
so far. Trying to sip from that firehose could have
enormous consequences.

-- 
Greg
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to