From: eyal DOT ben-david AT aks DOT com To: cdkrug AT aol DOT com cc: djgpp AT delorie DOT com Message-ID: <42256551.00400BFF.00@aks.com> Date: Sun, 16 Nov 1997 13:58:05 +0200 Subject: Re: Mysterious C++ STL compiler message Mime-Version: 1.0 Content-type: text/plain; charset=US-ASCII Precedence: bulk > >#include >#include <_string.h> > Correction #1: 'plus' and 'minus' are STL classes, beware of name clashes ! >enum operators { leftparen, plus, minus, times, divide}; > >String opString(operators theOp) >{ > switch (theOp) { > case plus: return " + "; > case minus: return " - "; > case times: return " * "; > case divide: return " / "; > case leftparen: return " [ "; > default: return "\0"; > } >} > >void processOp > (operators theOp, stack & opStack, String & result) >{ > // pop stack while operators have higher precedence > while ((! opStack.empty()) && (theOp < opStack.top())) > { > result += opString(opStack.top()); A typo here. should be opStack.pop() > opString.pop(); > } > opStack.push(theOp); >} > The corrections above are not related to your problem. Probably G++ does not support enums as types for instantiating a container ('aggregation'). I suggest that you use ints instead your enum type. They probably have better performance and less generated code. Eyal.