This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: STL doesn't compile with gcc 2.8.1
You didn't understand; upgrade. Look:
MLO@mlinux 14 $ cat foo.cpp
#include <iostream>
#include <queue>
using namespace std;
int main() {
priority_queue<int> pq;
for (int i=1; i<4; i++) {
pq.push(i);
cout << "top: " << pq.top() << endl;
}
while (!pq.empty()) {
cout << pq.top() << endl;
pq.pop();
}
return 0;
}
MLO@mlinux 15 $ g++ --version
2.95.1
MLO@mlinux 16 $ g++ -ansi -Wall -o foo foo.cpp
MLO@mlinux 17 $ ./foo
top: 1
top: 2
top: 3
3
2
1
MLO@mlinux 18 $
--
Maurizio Loreti http://www.pd.infn.it/~loreti/mlo.html
Univ. of Padova, Dept. of Physics - Padova, Italy loreti@pd.infn.it