July 05, 2004 Re: more on operators | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ivan Senji | Ivan Senji wrote: <snip> > Although i would still prefer if > class A{} > int[A] associative; > > Was a nice compile time error: > "A" cannot be an index to associative array (missing opCmp and opEquals!) <snip> As has been said already, AAs ought not to require that the key type be comparable. See also my post half an hour ago on d.D: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/5406 Stewart. -- My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit. |
July 05, 2004 Re: more on operators | ||||
---|---|---|---|---|
| ||||
Posted in reply to Stewart Gordon | "Stewart Gordon" <smjg_1998@yahoo.com> wrote in message news:ccbf5v$1pjq$1@digitaldaemon.com... > Ivan Senji wrote: > <snip> > > Although i would still prefer if > > class A{} > > int[A] associative; > > > > Was a nice compile time error: > > "A" cannot be an index to associative array (missing opCmp and opEquals!) > <snip> > > As has been said already, AAs ought not to require that the key type be comparable. > > See also my post half an hour ago on d.D: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/5406 > What should the associative array require then? The thing i was complaining about isn't the AAs but opEquals and opCmp being in object! > Stewart. > > -- > My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit. |
July 05, 2004 Re: more on operators | ||||
---|---|---|---|---|
| ||||
Posted in reply to Ivan Senji | Ivan Senji wrote: <snip> >> See also my post half an hour ago on d.D: http://www.digitalmars.com/drn-bin/wwwnews?digitalmars.D/5406 > > What should the associative array require then? Only an opEquals. Oh yes, and a toHash. > The thing i was complaining about isn't the AAs but opEquals and opCmp being in object! I think we all understand this. The point being that the AA implementation is a blocker for tidying these things up. Stewart. -- My e-mail is valid but not my primary mailbox, aside from its being the unfortunate victim of intensive mail-bombing at the moment. Please keep replies on the 'group where everyone may benefit. |
Copyright © 1999-2021 by the D Language Foundation