Topic: STL: typedef iterator;


Author: stidev@gate.net (Solution Technology)
Date: 28 Mar 1995 20:15:42 GMT
Raw View
inside the STL classes there are declarations of the form:
typedef iterator;

WHat does it mean?  It can't be an integer since ++ wouldn't work correctly
on iterators, at least as far as I can determine.

Ken Walter





Author: pete@borland.com (Pete Becker)
Date: 29 Mar 1995 03:43:14 GMT
Raw View
In article <3l9qpe$1qk3@tequesta.gate.net>, stidev@gate.net (Solution Technology) says:
>
>inside the STL classes there are declarations of the form:
>typedef iterator;
>
>WHat does it mean?  It can't be an integer since ++ wouldn't work correctly
>on iterators, at least as far as I can determine.
>

 In the DESCRIPTIONS of the classes in STL you will see the
mentioned text. It is not legal C++, and the descriptions are not
intended to be legal C++. Rather, they describe what the requirements are
for a class of each type. It would have been clearer to have written those
lines like this:

 typedef XXX iterator; // fill in appropriate type

    -- Pete