TypeInfo.compare is not implemented

Leandro Motta Barros lmb at stackedboxes.org
Sat Nov 30 05:39:15 PST 2013


Hello,

I my FewDee game prototyping library (https://bitbucket.org/lmb/fewdee) I
ignored most of the usual reccomendations like "be careful with the GC,
it's slow" and "associative arrays are buggy in D, so avoid them". I just
used whatever I found convenient to have my stuff running with minimal
effort.

So, I did something that may be an abuse of D's associative arrays:

alias
  Tuple!(const(GameState), ALLEGRO_EVENT_TYPE)
  stateTypePair;

// GameState is a class, ALLEGRO_EVENT_TYPE is
// some integral data type

EventHandler[EventHandlerID][stateTypePair]
   _eventHandlers;

// EventHandler is a delegate. EventHandlerID is
// an integral type.

This used to work (surprisingly? :-) ) until very recently (when I upgraded
to DMD 2.064, it seems).

Now, I am getting this

   object.Error: TypeInfo.compare is not implemented

when I try to use my '_eventHandlers' AA.

So, any suggestions?

Thanks a lot!

LMB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20131130/3b45b63f/attachment.html>


More information about the Digitalmars-d-learn mailing list