[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

Map

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
XPUSR
Asked:
XPUSR
1 Solution
 
Alkali_GuyCommented:
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

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now