我很新的C++和Boost庫: 不知道什麼,我在下面的代碼做錯了: 我下面http://www.richelbilderbeek.nl/CppBoostGraphExample4.htm提升:模板參數錯誤數
typedef boost::adjacency_list
<
//Store all edges as a std::vector
boost::vecS,
//Store all vertices in a std::vector
boost::vecS,
//Relations are both ways (in this example)
//(note: but you can freely change it to boost::directedS)
boost::undirectedS,
//All vertices are person names of type std::string
boost::property<boost::vertex_name_t,std::string>,
//All edges are weights equal to the encounter frequencies
boost::property<boost::edge_weight_t,double>,
//Graph itself has a std::string name
boost::property<boost::graph_name_t,std::string>
> Graph;
發現這裏的例子
當我嘗試編譯代碼我得到
錯誤:錯號碼的模板參數(1,應該是3) /usr/include/boost/pending/property.hpp:22錯誤:爲' tempate struct boost :: property'
在我的代碼錯誤指向這一行:
boost::property<boost::edge_weight_t,double>
我使用的庫版本1.55
我算在'的boost :: adjacency_list' 7個模板參數,但您提供6.認爲自己可能會錯過'EdgeList' –
我仍然得到同樣的錯誤提供了一個額外的參數'listS' – unekwu