I am not able to compile below , where I want to use graph_bundle property of boost graph.
struct VertexProps
{
std::string VertexName;
};
struct EdgeProps
{
std::string edgeName;
};
struct GraphProps
{
std::string name;
};
boost::adjacency_list<boost::vecS, boost::vecS, boost::bidirectionalS, VertexProps, EdgeProps, GraphProps> g;
g[boost::graph_bundle].name = "myGraphName";
boost::dynamic_properties dp;
dp.property("name", get(&GraphProps::name, g)); //compile error on this line
std::ofstream xmlFile("output.graphml");
boost::write_graphml(xmlFile, g, dp, true);
xmlFile.close();
I am getting beloe compile error:
<>/boost/graph/detail/adjacency_list.hpp:2646:29: error: forming reference to void
2646 | typedef value_type& reference;
| ^~~~~~~~~
<>/boost/graph/detail/adjacency_list.hpp:2647:35: error: forming reference to void
2647 | typedef const value_type& const_reference;
| ^~~~~~~~~~~~~~~
<>/boost/graph/detail/adjacency_list.hpp:2651:13: error: forming reference to void
2651 | type;
| ^~~~
<>/boost/graph/detail/adjacency_list.hpp:2654:13: error: forming reference to void
2654 | const_type;
| ^~~~~~~~~~
test.cpp: In function ‘void writeGraph()’:
test.cpp:310:49: error: no matching function for call to ‘get(std::string GraphProps::*, Graph&)’
310 | dp.property("name", get(&GraphProps::name, g));
| ^
It seems , boost graph library can't support custom property name , which can be used dynamic_properties for writing in graphml.