GraphDom
Loading...
Searching...
No Matches
custom_edge_endpoint_less.h
1/*
2 * Copyright 2026 Michele Comparini
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef GRAPHDOM_CUSTOM_EDGE_ENDPOINT_LESS_H
8#define GRAPHDOM_CUSTOM_EDGE_ENDPOINT_LESS_H
9
10#include <type_traits>
11
12#include "../graph.h"
13#include "vertex_container.h"
14#include "edge_endpoint.h"
15
16namespace graphdom {
17 template <typename VertexType>
18 template <typename VertexContainerPointerType>
19 class graph<VertexType>::custom_edge_endpoint_less final {
20 public:
21 static_assert(
22 std::is_same< VertexContainerPointerType , graphdom::graph<VertexType>::vertex_container* >::value ||
23 std::is_same< VertexContainerPointerType , const graphdom::graph<VertexType>::vertex_container* >::value
24 ,
25 "The typename 'VertexContainerPointerType' of 'graphdom::graph<VertexType>::custom_edge_endpoint_less<VertexContainerPointerType>' class must be a pointer to graphdom::graph<VertexType>::vertex_container"
26 );
27
28 bool constexpr operator()(
29 const edge_endpoint<VertexContainerPointerType>* left,
30 const edge_endpoint<VertexContainerPointerType>* right) const;
31
32 using is_transparent = void;
33
34 bool constexpr operator()(
35 const edge_endpoint<VertexContainerPointerType>* left,
36 const vertex_container* right) const;
37
38 bool constexpr operator()(
39 const vertex_container* left,
40 const edge_endpoint<VertexContainerPointerType>* right) const;
41
42 private:
43 static constexpr std::less<const vertex_container*> less_functor = std::less<const vertex_container*>();
44 };
45}
46
47#include "impl/custom_edge_endpoint_less.h"
48
49#endif //GRAPHDOM_CUSTOM_EDGE_ENDPOINT_LESS_H
Every graph created using this library is an instance of a concrete class publicly derived,...
Definition graph.h:43
Definition adj_list.h:16