我知道有十亿个类似的主题,但我在其中看到的任何建议都没有帮助我解决这个问题......这是在一个保存为 header.h 的文件中
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <map>
using namespace std;
class Handler {
public:
Handler();
~Handler();
bool handle(int client);
void giveMaps(map<string, string> host, map<string,string> media>);
private:
map<string, string> hosts;
map<string, string> mediaLookup;
char buf_[1600];
char* getCurrentDate();
};
我的错误是“handler.h:18: error: expected ',' or '...' before '>' token”,原文中的第 18 行是“void giveMaps(map host, map media>);”
我已经尝试将这两个地图以及地图内的所有字符串都声明为 const,但到目前为止我什么都没有。我很肯定这很简单,我只需要另一双眼睛才能看到它......