cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
General C++ Programming
Question: How does this work...Vector<ty
Question: How does this work...Vector<type>::iterator
Aug 6, 2012 at 10:08pm UTC
Hart1ey
(2)
I have looked to look all over the web and i can not find an answer, could you explain to me how it works, and how it looks in the class it would be greatly appreciated thanks :)
Last edited on
Aug 6, 2012 at 10:09pm UTC
Aug 6, 2012 at 10:33pm UTC
Disch
(13742)
:: is the scope resolution operator. It tells you that 'iterator' is defined inside the vector<type> class.
'iterator' is a type name. Either a class, struct, or a typedef (probably a typedef).
It probably looks like this:
1
2
3
4
5
6
template
<...>
class
vector {
//...
typedef
_something_ iterator; };
For vector... _something_ is probably just
T*
. But it might also be a separate class. It depends on your implementation.
Aug 6, 2012 at 11:08pm UTC
Hart1ey
(2)
Oh i get it now, you are accessing it through :: and that lets you create an object out of it thanks :)
Topic archived. No new replies allowed.