Re: C++ overloaded operators and D

2014-11-13 Thread via Digitalmars-d
++ and D overloaded operators should live in different worlds. Can't we map both static and member operators to opBinary resp. opBinaryRight members in this case? How likely is it that both are defined on the C++ side, and if they are, how likely is it that they will behave differently

Re: C++ overloaded operators and D

2014-11-13 Thread IgorStepanov via Digitalmars-d
) will not provide the same behaviour as operator+ in D. Thus: C++ and D overloaded operators should live in different worlds. Can't we map both static and member operators to opBinary resp. opBinaryRight members in this case? How likely is it that both are defined on the C++ side

Re: C++ overloaded operators and D

2014-11-12 Thread IgorStepanov via Digitalmars-d
); //unable to map it to D, because static module-level Foo opAdd(int, Foo) will not provide the same behaviour as operator+ in D. Thus: C++ and D overloaded operators should live in different worlds.

Re: C++ overloaded operators and D

2014-11-12 Thread via Digitalmars-d
as operator+ in D. Thus: C++ and D overloaded operators should live in different worlds. Can't we map both static and member operators to opBinary resp. opBinaryRight members in this case? How likely is it that both are defined on the C++ side, and if they are, how likely

Re: C++ overloaded operators and D

2014-11-12 Thread IgorStepanov via Digitalmars-d
module-level Foo opAdd(int, Foo) will not provide the same behaviour as operator+ in D. Thus: C++ and D overloaded operators should live in different worlds. Can't we map both static and member operators to opBinary resp. opBinaryRight members in this case? How likely is it that both are defined

Re: C++ overloaded operators and D

2014-11-12 Thread via Digitalmars-d
operator+(int a, Foo f); //unable to map it to D, because static module-level Foo opAdd(int, Foo) will not provide the same behaviour as operator+ in D. Thus: C++ and D overloaded operators should live in different worlds. Can't we map both static and member operators to opBinary resp

Re: C++ overloaded operators and D

2014-11-12 Thread IgorStepanov via Digitalmars-d
can't be mapped to D, if them implemented as static functions: Foo operator+(int a, Foo f); //unable to map it to D, because static module-level Foo opAdd(int, Foo) will not provide the same behaviour as operator+ in D. Thus: C++ and D overloaded operators should live in different worlds. Can't

C++ overloaded operators and D

2014-11-11 Thread IgorStepanov via Digitalmars-d
Now D provides very powerfull means to link C++ code with D. However D doesn't allow to call C++ overloaded operators. It's very annoying, because C++ code may don't provide non-operator analogues. What we know about C++ overloadable operators? Overloaded operator in C++ is a trivial

Re: C++ overloaded operators and D

2014-11-11 Thread deadalnix via Digitalmars-d
On Tuesday, 11 November 2014 at 22:26:48 UTC, IgorStepanov wrote: Now D provides very powerfull means to link C++ code with D. However D doesn't allow to call C++ overloaded operators. It's very annoying, because C++ code may don't provide non-operator analogues. What we know about C++