STL defect?
Timothy Ritchey
tritchey@vne.com
Tue Sep 1 23:40:00 GMT 1998
what are you trying to do in the example? try the following example,
operator-> works for me here. I don't see what you are "pointing at" in
your example. The error you get is not that operator->() isn't
implemented, just that you have used it incorrectly. Notice the error
about aggregate type. Consider what you would do with a pointer to a
double. I can't think of any case where you would need to use the
operator-> on it. it is not an aggregate of additional parts.
#include <iostream>
#include <vector>
#include <deque>
class A {
public:
double x;
};
int main(int argc, char *argv[]) {
vector<A> V;
A a;
a.x = 1.1;
V.push_back(a);
vector<A>::iterator I;
I = V.begin();
cout << I->x << "\n";
return 0;
};
More information about the Gcc
mailing list