#include <map>
#include <string>
#include <iostream>
using namespace std;
typedef map<int, string> mymap_t;
void somefunction(mymap_t::const_iterator first, mymap_t::const_iterator last)
{
mymap_t subclone(first, last);
// use subclone -- it is a mymap_t now :)
for (mymap_t::iterator it = subclone.begin(); it!=subclone.end(); ++it)
{
it->second += '!';
std::cout << "first = " << it->first << ", second = " << it->second << std::endl;
}
}
int main()
{
mymap_t mymap;
mymap[1] = "One";
mymap[2] = "Two";
mymap[3] = "Three";
somefunction(mymap.begin(), mymap.end());
return 0;
}