Skip to content

Do not use type deduction when invoking visitor functions #179

@akrzemi1

Description

@akrzemi1

The implementation of the algorithms, use type deduction when invoking member functions of the visitors, as in:

if constexpr (has_on_discover_vertex<G, Visitor>) {
  visitor.on_discover_vertex({source, *find_vertex(g, source)}); // <-- no type of the argument
}

See https://github.com/stdgraph/graph-v2/blob/master/include/graph/algorithm/dijkstra_shortest_paths.hpp#L142.

As a consequence, I cannot my visitor like this:

struct MyVisitor
{
  void on_discover_vertex(auto const& v)
  {
    process(v.id);
  }
};

Even though I have satisfied all the requirements of a visitor.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions