for(ItemTemplateListIterator iter = item_template_list.begin(); iter != item_template_list.end(); ++iter) {
int id = iter->first;
string description = iter->second->description;
some_file_stream << id << endl;
some_file_stream << description << endl;
}
Where item_template_list is a map of <int, MyClass*>, ItemTemplateListIterator is a typedef for a const_iterator of map<int, MyClass*> and MyClass has a public string property called description.