Graphle
1.0.0
A C++20 header-only graph library
Loading...
Searching...
No Matches
graphle
utility
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
7
namespace
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
}
common.hpp
graph.hpp
graphle::vertex_of
typename std::remove_cvref_t< G >::vertex_type vertex_of
Definition:
graph.hpp:91
graphle::util
Definition:
doxygen.hpp:13
graphle::util::find_vertex
constexpr vertex_of< G > find_vertex(G &&graph, F &&pred)
Definition:
vertex_utils.hpp:18
graphle::graph
Definition:
graph.hpp:51
graphle::graph::get_vertices
GetVertices get_vertices
Definition:
graph.hpp:78
vertex
Definition:
visitor.cpp:5
Generated by
1.9.5