Vector iterator

Hi guys,

I have a question about vector iterators. Maybe it's should be in a beginner thread, if yes I'm so sorry about that. I looking at the std::find_if func template here on cplusplus site

http://www.cplusplus.com/reference/algorithm/find_if/

.. in example when you want to print a iterator value you have to dereference iterator with
*
(they use
*it
see in the above link example)

My code is below, and I don't understand why I don't have to dereference my iterator to get its value. It's enough to write
it
to get the value.


1
2
3
4
5
std::vector<std::pair<std::wstring, std::wstring>>::iterator it = std::find_if(lFileList.begin(), lFileList.end(), [&](std::pair<std::wstring, std::wstring> const & pair){
				return pair.first == selDoc;
			});
			
std::wstring ACSLiink = GetDocumentACSRequestTask(it->second); // func parameter is a std::wstring  



Please, Can you explain it to me. I always think about the iterator as a pointer. If you can suggest me a good article about it I would appreciate.



Last edited on
it->second is equivalent to (*it).second.
OMG .. shame on me.. ty for this quick answer
Registered users can post here. Sign in or register to post.