c++ - 编译器喊出文本 ">"是意外的 C++ XLC

标签 c++ templates compilation header c++-standard-library

我已经在我的头文件中声明了一个函数。

我不知道为什么,但编译器提示这一行并说 "The Text ">" is unexpected。

我正在使用 AIX 5.3 和 XLC/VAC 编译器。也许我对函数的定义也有问题,但我假设 map 必须知道它所持有的类型是什么才能工作。

有问题的行打印在下面。

std::map<std::string , std::list<std::pair<int, Event*> > * > * functionX(Customer * id, std::multimap<string, CustomerDetails> * p_mapWithCustomers);

我假设这是函数的正确声明

按照下面的建议,我已经定义了 typedef,不幸的是,这只是转移了问题,现在我在 typedef 的行上遇到了同样的错误。

typedef std::pair<int, Event* > pair_event_t;
typedef std::map<std::string, pair_event_t * > map_rule_t;

最佳答案

问题是 >>> 除非你使用的是 c++11,这是有效的,插入一个空格 >>

std::map<std::string , std::list<std::pair<int, Event*> >*> * functionX(Customer * id, std::multimap<string, CustomerDetails> * p_mapWithCustomers);

关于c++ - 编译器喊出文本 ">"是意外的 C++ XLC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9432519/

相关文章:

c++ - std::bind 不适用于引用?

c++ - 新创建的暂停进程的 EIP 仅在 Windows XP 上失败 - kernel32.dll 镜像下的 EIP?

c++ - 海军作战任务,无法使用setw()分配数组,您能帮我吗?

c++ - 在 MacOS 上 boost 正则表达式构建失败

c++ - 如何用宏替换 "template <typename ..."?

c++ - 模板化赋值运算符问题

c++ - 为什么我收到错误 "non-template ' f' used as template”

c - 如何使用#pragma pack(1) OR/Zp1 以便它们单独影响应用程序定义结构的打包,而不影响 Windows SDK 中定义的结构?

Java.lang.classnotfoundException - HelloWorld.class

c++ - cc1plus : Virtual memory exhausted