digitalmars.D - Default opCmp() for classes
- Uwe Salomon (9/9) Apr 06 2005 Hello,
- Stewart Gordon (8/16) Apr 06 2005 I'm not sure if anyone knows the original reason for putting it in. And...
- Matthew (2/7) Apr 06 2005 I think you have it right. FWIW, it's a very unpopular feature.
Hello, what exactly is the reason for the existence of a default opCmp() for classes? Every class that an opCmp() really makes sense for has to implement it anyways, and the others don't want to be compared i guess. If there weren't a standard implementation (or the standard would only throw an exception) this would help detecting programming errors. Or is the operator necessary for the AA-implementation? Ciao uwe
Apr 06 2005
Uwe Salomon wrote:Hello, what exactly is the reason for the existence of a default opCmp() for classes? Every class that an opCmp() really makes sense for has to implement it anyways, and the others don't want to be compared i guess. If there weren't a standard implementation (or the standard would only throw an exception) this would help detecting programming errors. Or is the operator necessary for the AA-implementation?I'm not sure if anyone knows the original reason for putting it in. And several of us have been wanting to get rid of it for ages. http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/10558 Stewart. -- My e-mail is valid but not my primary mailbox. Please keep replies on the 'group where everyone may benefit.
Apr 06 2005
"Uwe Salomon" <post uwesalomon.de> wrote in message news:opsotlm9jm6yjbe6 sandmann.maerchenwald.net...Hello, what exactly is the reason for the existence of a default opCmp() for classes? Every class that an opCmp() really makes sense for has to implement it anyways, and the others don't want to be compared i guess. If there weren't a standard implementation (or the standard would only throw an exception) this would help detecting programming errors. Or is the operator necessary for the AA-implementation?I think you have it right. FWIW, it's a very unpopular feature.
Apr 06 2005