【发布时间】:2017-03-10 17:43:11
【问题描述】:
我正在尝试使用以下定义序列化 boost::graph:
typedef boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS, boost::no_property,
boost::property<boost::edge_weight_t, float> > mygraph_t;
typedef boost::property_map<mygraph_t, boost::edge_weight_t>::type WeightMap;
typedef mygraph_t::vertex_descriptor vertex;
typedef mygraph_t::edge_descriptor edge_descriptor;
mygraph_t topoGraph;
WeightMap weightMap;
问题是由我尝试序列化“weightMap”引起的
即使我包含了我认为是适当的头文件,它也会失败并显示以下错误消息: "boost/graph/adj_list_serialize.hpp"
/usr/include/boost/serialization/access.hpp:118:9: error: ‘struct boost::adj_list_edge_property_map<boost::undirected_tag, float, float&, long unsigned int, boost::property<boost::edge_weight_t, float>, boost::edge_weight_t>’ has no member named ‘serialize’
t.serialize(ar, file_version);
^
非常感谢您的帮助。
【问题讨论】:
-
为了给您的问题一些价值,请发布相关代码 sn-p 以显示您如何进行序列化。
标签: c++ dictionary serialization boost graph