Thread overview | |||||
---|---|---|---|---|---|
|
April 06, 2005 Default opCmp() for classes | ||||
---|---|---|---|---|
| ||||
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 |
April 06, 2005 Re: Default opCmp() for classes | ||||
---|---|---|---|---|
| ||||
Posted in reply to Uwe Salomon | 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. |
April 07, 2005 Re: Default opCmp() for classes | ||||
---|---|---|---|---|
| ||||
Posted in reply to Uwe Salomon | "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. |
Copyright © 1999-2021 by the D Language Foundation