Solved

std::search - question about last parameter...

Posted on 2008-06-22
2
156 Views
Last Modified: 2010-04-21
Hi,

Quote from cplusplus.com:

first1, last1
    Forward iterators to the initial and final positions of the searched sequence. The range used is [first1,last1), which contains all the elements between first1 and last1, including the element pointed by first1 but not the element pointed by last1.

Does this mean that if I'm looking for a vector that has a size of 1, that the last element of the main vector won't be searched? I.e:

ABCD
D

D wouldn't be found?

Thanking you. :)
Uni
0
Comment
Question by:Unimatrix_001
2 Comments
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 21843157
No, the 'last' element (available via the 'end()' member of the respective container) is a 'pseudo-iterator' (you'll get an exception when thrying to access its contents) representing a special state of the iteration, thus I just assume poor wording while having that in mind.
0
 
LVL 3

Author Closing Comment

by:Unimatrix_001
ID: 31469616
Okay thanks - that makes more sense. :)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now