Graphle 1.0.0
A C++20 header-only graph library
Loading...
Searching...
No Matches
Classes | Namespaces | Concepts | Macros | Enumerations
visitor.hpp File Reference
#include <common.hpp>
#include <graph/graph.hpp>
#include <utility/functional.hpp>
#include <functional>

Go to the source code of this file.

Classes

class  graphle::search::search_visitor< Derived, Graph >
 
struct  graphle::search::visitor_from_arguments< Graph, DiscoverVertex, DiscoverLeaf, DiscoverBranch, DiscoverNewEdge, DiscoverSeenEdge, BeginSearch, FinishSearch >
 

Namespaces

namespace  graphle
 
namespace  graphle::search
 

Concepts

concept  graphle::search::search_visitor_type
 
concept  graphle::search::search_visitor_ref
 

Macros

#define GRAPHLE_VISIT_DERIVED(F, D, ...)
 

Enumerations

enum class  graphle::search::visitor_result { graphle::search::visitor_result::CONTINUE , graphle::search::visitor_result::STOP_TREE , graphle::search::visitor_result::STOP_SEARCH }
 
enum class  graphle::search::nonlocal_visitor_result { graphle::search::nonlocal_visitor_result::CONTINUE , graphle::search::nonlocal_visitor_result::STOP_SEARCH }
 

Macro Definition Documentation

◆ GRAPHLE_VISIT_DERIVED

#define GRAPHLE_VISIT_DERIVED (   F,
  D,
  ... 
)
Value:
[&] { \
if constexpr (requires (Derived d) { d.F(__VA_ARGS__); }) { \
auto invoker = [&] () -> decltype(auto) { \
return static_cast<Derived*>(this)->F(__VA_ARGS__); \
}; \
\
\
using result_t = std::invoke_result_t<decltype(invoker)>; \
\
if constexpr (std::is_same_v<result_t, void>) { \
invoker(); \
return D; \
} else { \
return invoker(); \
} \
} else return D; \
}()

Definition at line 10 of file visitor.hpp.