gpt4 book ai didi

c++ - 将 unordered_set_of 与 Boost.Bimap 一起使用时出错

转载 作者:行者123 更新时间:2023-11-30 04:10:12 32 4
gpt4 key购买 nike

我正在尝试关注 this example来自文档(请参阅 word_counter 的 typedef)。

#include <string>
#include <boost/bimap.hpp>
#include <boost/bimap/unordered_set_of.hpp>

typedef boost::bimap
<
boost::bimap::unordered_set_of< std::string >,
std::string
> MyBimap;

抛出的错误是

test.cpp:11:1: error: wrong number of template arguments (1, should be 5) In file included from /usr/include/boost/bimap.hpp:13:0, from test.cpp:3: /usr/include/boost/bimap/bimap.hpp:133:7: error: provided for ‘template class boost::bimaps::bimap’ test.cpp:11:10: error: invalid type in declaration before ‘;’ token

最佳答案

你打错了。而不是

boost::bimap::unordered_set_of< std::string >,

使用

boost::bimaps::unordered_set_of< std::string >,

在模板中。

然后它会编译。

关于c++ - 将 unordered_set_of 与 Boost.Bimap 一起使用时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20753302/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com