Skip to content

Should vertex_id_t<G> be default-constructible? #172

@akrzemi1

Description

@akrzemi1

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:

  1. Add default-constructibility to the concept
  2. Use std::optional in 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions