如何序列化类型 boost::labeled_graph
我有一个 boost:labeled_graph 对象类型,它似乎没有必要的序列化功能。
error: ‘class boost::labeled_graph<boost::adjacency_list<boost::listS, boost::listS,
boost::undirectedS, Space, spaceEdge, graphProperties, boost::listS>, std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, boost::defaultS>’ has no member named
‘serialize’
有什么方法可以将labeled_graphs序列化到文件中吗?
I've got a boost:labeled_graph object type which does not seem to have necessary functions for serialization.
error: ‘class boost::labeled_graph<boost::adjacency_list<boost::listS, boost::listS,
boost::undirectedS, Space, spaceEdge, graphProperties, boost::listS>, std::basic_string<char,
std::char_traits<char>, std::allocator<char> >, boost::defaultS>’ has no member named
‘serialize’
Any way of serializing labeled_graphs to file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我以前没见过,但是
labeled_graph
看起来像一个薄包装围绕着您选择的另一个图表,在本例中,您根据该错误的外观选择了adjacency_list
。通过
对序列化邻接列表提供了 boost 支持,因此看起来您可以使用 自由函数序列化 对此非常明智,有些东西 喜欢:I've not seen before, but
labeled_graph
looks like a thin wrapper around another graph of your choosing, in this case you choseadjacency_list
by the looks of that error. There's boost support for serializing adjacency lists via<graph/adj_list_serialize.hpp>
, so it looks like you can use the free function serializing quite sensibly with this, something like: