我在下面的代码片段中显示了一个 std::pair 声明,并且 g++ 在第 152 行的编译错误下方发出了“错误:模板参数的数量错误(1,应该是 2)”。我是这个 std::pair 的新手,我想知道我做错了什么。所以提到的行号已在下面的代码片段中标记。谢谢。
std::vector<
std::pair<EndPointAddr* requesterServiceAddr,
EndPointAddr* requestedServiceAddr>* //LINE 152 is HERE
> mServiceSubscriptionsList;
In file included from ServiceRegistrar.hpp:8:0,
from ServiceRegistrar.cpp:7:
../control_api/ServiceRegistrarAPI.hpp:152:95: error: wrong number of template arguments (1, should be 2)
........
.......
../control_api/ServiceRegistrarAPI.hpp:153:14: error: template argument 1 is invalid
../control_api/ServiceRegistrarAPI.hpp:153:14: error: template argument 2 is invalid
In file included from ../control_api/ServiceRegistrarAPI.cpp:5:0: