On 09/07/2011 05:28 AM, Brad Roberts wrote:
On Tuesday, September 06, 2011 9:09:06 AM, Timon Gehr wrote:
On 09/06/2011 04:13 PM, d coder wrote:
Greetings
It seems D assumes that these operators should return a bool value.
For example a< b is re-written as a.opCmp(b)< 0.
In my application, I wanted to overload comparison and equality
operators to return user defined values. Is that possible in D? If so
how?
Regards
- Puneet
That is currently impossible. =/
You'll have to use named member functions, eg. less, greater and equal.
Normally I try to avoid nit picking phrasing in public forums, but in
this case it's important. It's not just 'currently' impossible,
not 'just' currently, but I never said 'just'. ;)
it's by design with no intention to change.
I never said there was. I wanted to express I wish there was.
Timon