STL defect?
Tue Sep 1 12:32:00 GMT 1998

This small test program demonstrates either a defect in STL design or
in egcs implementation.

#include <vector>
#include <deque>

main () {
  vector<double> V;
  deque<double> D;
  vector<double>::iterator I;
  deque<double>::iterator J;
  double* p1 = J.operator->();
  double* p2 = I.operator->();

g++ -c In function `int main()': request for member `operator ->' in `I', which is of non-aggregate type `double *'

The problem is that the builtin pointer types don't implement operator->, so
operator-> won't work for vector, whose underlying representation of
an iterator is a pointer.  But STL says that iterators should have an

More information about the Gcc mailing list