I am currently studying STL, and I have uncertainty in the search and constant iterators. Let's say I have a search function:
some_stl_container::const_iterator found = myContainer.find(value);
After that, I have to check what I got for found , against another const_iterator, or is it valid to make a check against just an iterator. Basically, there will be some difference between this:
if(found!=myContainer.cend())
and this:
if(found!=myContainer.end())
The first one looks more accurate (at least for me), but the second should work fine, right?
source share