2013-12-24 111 views
1

我正在嘗試從文檔中關注this example(請參閱word_counter的typedef)。使用unordered_set_of與Boost.Bimap錯誤

#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

+0

什麼編譯器和版本? – StilesCrisis

回答

2

你有一個錯字。 而不是

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

在模板中使用

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

它會編譯。