Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Is iterator member of vector class?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Sun Jun 10, 2012 5:50 am    Post subject: Is iterator member of vector class? Reply with quote

(C++)

How is iterator implemented in vector class?

vector<int> v;
vector<int>::iterator i = v.begin();

I know vector is a template class. And iterator is an object. And also iterator is not a static object.

Then why we are not accessing it through dot operator.

And what does vector class looks like. Is iterator a member of vector class?

_________________
Back to top
View user's profile Send private message Send e-mail
Freiza
Grandmaster Cheater
Reputation: 22

Joined: 28 Jun 2010
Posts: 662

PostPosted: Tue Jun 12, 2012 5:21 am    Post subject: Reply with quote

I got the solution:

Iterator is defined in vector namespace and typedef inside vector class.

In easy words,

iterator is nested class inside vector class. It is a public member. Since it is not a data-member but a nested class, so we access it using the " :: " operator.

_________________
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites