Solved

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

Posted on 2008-06-22
2
157 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Want to delete all my personal data 13 137
Parsing XML instructions in Java/any other language.... 3 104
ASP.net build a IF/Then Walkthrough Guide 1 190
Grammars for C C++ and java 1 113
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.

932 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

12 Experts available now in Live!

Get 1:1 Help Now