Impishly stupid template question

Jeremy Gibson jtgibsontelusnet
Tue Jun 20 22:58:06 PDT 2006


I have a medium-weight queue class which I created some time in November or
December for general use, but never actually went ahead and tried using it until
now.  The queue class is a class template.

In C++, it's possible to create a member variable of template class: for
instance, "vector<int> coordinates", "vector<ObjectClass*> objectTable", etc.

In D, what is the equivalent?  I tried using "queue!(ac_event) event_queue" as a
member variable, but I'm getting compile errors:

alliance.d(74): class queue.queue(var_type) is used as a type
alliance.d(74): variable alliance.alliance.ac_game.event_queue voids have no val
ue

I know that templates in D have to be instantiated to be of use, so I'm
wondering how I can tell D that I want the event_queue variable to indicate an
instantiated queue of ac_event objects... what type do I need to assign to the
member variable, etc.?





More information about the Digitalmars-d-learn mailing list