Mail Archives: djgpp/2000/07/07/05:52:52
>
>Hi everybody,
>I am looking for sample code for stl running with djgpp. I am just testing
>examples from ObjectSpace, but some of them cannot be compiled (stack1.cpp
>for example - see attached file).
>Please let me know about some easy collection of examples which might run
>with djgpp.
>
>Thanks, Petr Maxa.
>#include <iostream.h>
>#include <stl.h>
>
>int main ()
>{
> stack<deque<int> > s;
> s.push (42);
> s.push (101);
> s.push (69);
> while (!s.empty ())
> {
> cout << s.top () << endl;
> s.pop ();
> }
> return 0;
>}
How could this possibly compile? s is a stack of deques, and you are
trying to push ints into that.
This is positively not a problem with djgpp, but with the code.
How old are those samples, anyway? <iostream.h> should not be in modern
code, use <iostream> instead. And including <stl.h> will give you HUGE
compile times. It's better to include only those headers you really
need (<stack> and <deque> in your case).
--
Manni
- Raw text -