Impishly stupid template question

Jeremy Gibson jtgibsontelusnet
Wed Jun 21 14:16:40 PDT 2006


In article <e7apdv$1kkd$1 at digitaldaemon.com>, Jeremy Gibson <jtgibson telus net>
says...
>
>>That example compiles.  The error message you got appears whenever there's
>>_any_ issue with the template.  Chances are something else is up- look for
>>other error messages.  I've found that in any D program with templates,
>>only the first one or two error messages are worth anything.
>
>Those are the only error messages I'm getting, unfortunately, but I'll see
>what's what in the queue module.  Sleep is more appealing than debugging right
>now, so I'll have to look into it in the morning... =)

After further testing, using /+ +/ comments to block out the ENTIRE contents of
the queue class, as well as removing all derived classes (stacks and pools) from
the queue module, I still suffered from these errors:

alliance.d(74): template instance queue is not a template declaration, it is a i
mport
alliance.d(74): queue!(ac_event) is used as a type
alliance.d(74): variable alliance.alliance.ac_game.event_queue voids have no val
ue

The problem, as the cryptic error message hinted at, was a name conflict between
the module "queue" and the class template name "queue".  I wanted to keep the
queue as a portable module for use in my other projects, but went ahead and
renamed the queue class to "ac_queue" for consistency with my other classes in
the project -- not surprisingly, everything then compiled perfectly (working
perfectly is another matter... I still have to write a test suite!).

I'll have to think up of a good alternate name for the module and/or class when
I add it to my code library.





More information about the Digitalmars-d-learn mailing list