I have a boost::adjacency_list with a bundled property for the nodes.
using KinematicGraph =
boost::adjacency_list<boost::vecS,
boost::vecS,
boost::bidirectionalS,
Model::SimulationObjects::map<std::reference_wrapper>::as<std::variant>>;
I am trying to add an edge to a graph using boost::add_edge
function
auto from = reinterpret_cast<const void *>(std::addressof(mapping.from()));
auto to = reinterpret_cast<const void *>(std::addressof(mapping.to()));
boost::add_edge(vertexMap[from], vertexMap[to], m_simulationObjectsGraph);
where vertexMap
is just std::unordered_map<const void *, KinematicGraph::vertex_descriptor> vertexMap;
, which I use to keep track of the added vertices.
However, this code doesn’t compile.
[build] In file included from /home/dev/.conan2/p/b/boosta593711c2d7a0/p/include/boost/graph/adjacency_list.hpp:255:
[build] /home/dev/.conan2/p/b/boosta593711c2d7a0/p/include/boost/graph/detail/adjacency_list.hpp:2453:17: error: call to implicitly-deleted default constructor of 'std::variant<std::reference_wrapper<mandos::SimulationObject<mandos::Particle3DTag>>>'
[build] 2453 | bidir_rand_stored_vertex() {}
I have no clue why it says its not able to instantiate the bundled property of a vertex, I haven’t ask for it.
If I remove the add_edge
line, compiles fine.