Graphle 1.0.0
A C++20 header-only graph library
Loading...
Searching...
No Matches
vertex_utils.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <common.hpp>
4#include <graph/graph.hpp>
5
6
7namespace graphle::util {
17 template <graph_ref G, typename F>
18 constexpr inline vertex_of<G> find_vertex(G&& graph, F&& pred) {
19 for (auto* vertex : graph.get_vertices()) {
20 if (std::invoke(pred, vertex)) return vertex;
21 }
22
23 return nullptr;
24 }
25}
typename std::remove_cvref_t< G >::vertex_type vertex_of
Definition: graph.hpp:91
constexpr vertex_of< G > find_vertex(G &&graph, F &&pred)
GetVertices get_vertices
Definition: graph.hpp:78