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

时间:2013-12-24 00:38:27

标签: c++ boost bimap boost-bimap

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

#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:错误:模板参数数量错误(1,应为5)   在/usr/include/boost/bimap.hpp:13:0中包含的文件中,来自test.cpp:3:   /usr/include/boost/bimap/bimap.hpp:133:7:错误:提供'模板类boost :: bimaps :: bimap'   test.cpp:11:10:错误:';'标记

之前的声明中的无效类型

1 个答案:

答案 0 :(得分:2)

你有一个错字。 而不是

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

使用

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

在模板中。

然后编译。