Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Map

Posted on 2006-10-23
1
Medium Priority
?
248 Views
Last Modified: 2013-11-20
map<int, double>::iterator iterator = anumbermap.end();
iterator--;
double d = (iterator--)->second;

Is there a more elegant method for retriving the elements at two places from the end? Something like:
iterator -=  2
double d = iterator->second;
0
Comment
Question by:XPUSR
1 Comment
 
LVL 5

Accepted Solution

by:
Alkali_Guy earned 200 total points
ID: 17793552
No, ++ and -- are the only overloads for this purpose.  The best you can do is:

for (char i=0;i<2;i++) iterator--;
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month9 days, 2 hours left to enroll

877 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