【发布时间】:2016-07-11 16:48:38
【问题描述】:
我试图理解boost::disjoint_sets_with_storage,但即使是最简单的例子也不起作用,我不明白为什么。
#include <boost/pending/disjoint_sets.hpp>
int main(){
boost::disjoint_sets_with_storage<> union_find;
union_find.make_set(1);
//..
}
上面的代码可以编译,但会产生段错误。我想使用整数作为元素,但在boost documentation 中没有“元素”模板参数,所以我假设它推断类型。但是,问题是什么?谢谢
【问题讨论】:
-
我从不喜欢这个实现。对于我的所有需求,我使用自己的实现,使用列表和无序地图。
-
@Greg 谢谢,但不,它的界面不一样
标签: c++ c++11 boost disjoint-sets union-find