Show mm.cc syntax highlighted
#include <map>
#include <iostream>
using namespace std;
class t
{
public:
t() { cout << "no-arg Constructor" << endl; }
t(const t& t2) { cout << "Copy Constructor" << endl; }
~t() { cout << "Destructor" << endl; }
void f() { cout << "f()" << endl; }
};
int main()
{
cout << "abc constr" << endl;
t a,b,c;
map <int, t> v;
map <int, t>::iterator i;
cout << "copying into map" << endl;
v[0] = a;
v[1] = b;
v[2] = c;
i=v.begin();
cout << "Erasing element 0" << endl;
v.erase(i);
i++;
cout << "Erasing element 1" << endl;
v.erase(i);
i++;
cout << "Erasing element 2" << endl;
v.erase(i);
cout << "abc Destructors" << endl;
}
See more files for this project here