From: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire) Newsgroups: comp.os.msdos.djgpp Subject: Re: More STL woes Date: 11 Nov 1997 18:00:33 GMT Organization: The National Capital FreeNet Lines: 34 Message-ID: <64a6g1$hnf@freenet-news.carleton.ca> References: <346881DE DOT 97AEE50F AT pentek DOT com> Reply-To: ao950 AT FreeNet DOT Carleton DOT CA (Paul Derbyshire) NNTP-Posting-Host: freenet3.carleton.ca To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Charles Krug (charles AT pentek DOT com) writes: > I fed the following to gxx: > > #include > > int main() > { > queue fred; > > return 0; > } > > And got the following error: > > d:/djgpp/lang/cxx/stack.h:57: `int' is not an aggregate type > d:/djgpp/lang/cxx/stack.h:57: confused by earlier errors, bailing out > class queue (from stack.h): > > template Look. Queue expects a container, not an int. Queues, like stacks, build on an existing container. You should use queue< deque > fred; (Usually, a deque or a list. Deques have O(1) push_front and push_back and pop_front and pop_back, so they are ideal for queues and stacks.) -- .*. Where feelings are concerned, answers are rarely simple [GeneDeWeese] -() < When I go to the theater, I always go straight to the "bag and mix" `*' bulk candy section...because variety is the spice of life... [me] Paul Derbyshire ao950 AT freenet DOT carleton DOT ca, http://chat.carleton.ca/~pderbysh