This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: STL defect?
- To: nbecker at fred dot net, egcs at cygnus dot com
- Subject: Re: STL defect?
- From: Timothy Ritchey <tritchey at vne dot com>
- Date: Wed, 02 Sep 1998 03:48:08 +0000
- Organization: Vacuum Genesis
- References: <E0zDsev-0006Tf-00@hns.com>
- Reply-To: tritchey at vne dot com
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;
};