我正在尝试打印地图元素,但每次将迭代器分配给地图时都会收到一条错误消息。错误消息太长且不可读..请帮助:p
//a.h
#include<string>
#include<map>
class B; //forward declaration of class B
class A
{
typedef std::map<std::string, B *> container;
private:
std::string name;
container Bs;
public:
void printAllBs() const;
typedef container::iterator set_itr_T;
};
//a.cpp
#include<a.h>
#include<string>
#include<map>
#include<b.h>
#include<iostream>
void A::printAllBs() const
{
for(set_itr_T it = Bs.begin(); it!=Bs.end(); ++it) //error here
{}
}