graph-v2
graph-v2 copied to clipboard
Should `vertex_id_t<G>` be default-constructible?
Concept graph::adjacency_list does not require that vertex_id_t<G> be default-constructible. However, views::incidence (which is constrained with graph::adjacency_list) uses default construction:
https://github.com/stdgraph/graph-v2/blob/master/include/graph/views/incidence.hpp#L83
This should be fixed in one or the other way:
- Add default-constructibility to the concept
- Use
std::optionalin the implementation instead of using a default-constructed value.
I personally do not like the idea of requiring default values. But if this would make the algorithm slightly faster, it is not a problem to come up with a default-constructed ID.