[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug in gcc? in STL? <list> collides with my operator overloading
From: |
Andreas Krueger |
Subject: |
bug in gcc? in STL? <list> collides with my operator overloading |
Date: |
Tue, 6 Mar 2001 20:25:34 +0100 |
Hello,
I have found a very peculiar problem in g++
which I can't solve. Perhaps it's even an STL-bug or gcc-bug?
I need help.
I have written a (template) container "measure" to hold
a +/- b
(for error propagation)
with lots of operator overloading.
It is part of a bigger physics project, but here I mention just the actual
problem of porting it to unix.
Everything works fine, the class is tested in many situations,
BUT:
As soon as I #include <list>
I get very strange errors on gcc (version 2.95.2),
concerning /usr/include/g++/stl_iterator.h
-> www.andreask.de/cpp/measure/gcc-errors.txt
If I don't use a STL-container like <list>
or if I use M$ Visual-C++, I have
no problems at all.
Please have a look at this.
When you un-comment the second line - the trouble starts.
#include <iostream>
// #include <list> // here is the problem
#include <math.h>
#include "measure.h"
void main(){
typedef measure<double> measure;
measure a=measure(2,0.1);
test_measureclass();
interactive_test_measureclass();
}
You can find my class "measure.h" at:
-> www.andreask.de/cpp/measure/measure.h
and the (above) test program at:
-> www.andreask.de/cpp/measure/gcc-test.cpp
What can I do? What code is wrong?
Need the STL or g++ be changed?
Can you think of a workaround?
Thanks a lot in advance.
ciao,
Andreas
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- bug in gcc? in STL? <list> collides with my operator overloading,
Andreas Krueger <=