digitalmars.D - Default opCmp() for classes
- "Uwe Salomon" <post uwesalomon.de> Apr 06 2005
- Stewart Gordon <smjg_1998 yahoo.com> Apr 06 2005
- "Matthew" <admin.hat stlsoft.dot.org> Apr 06 2005
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. 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









Stewart Gordon <smjg_1998 yahoo.com> 