Graphle 1.0.0
A C++20 header-only graph library
Loading...
Searching...
No Matches
concepts.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <common.hpp>
4
5
6namespace graphle::meta {
11 template <typename T> class always_false {
12 private:
13 struct hidden_type {};
14 public:
15 constexpr static inline bool value = std::is_same_v<T, hidden_type>;
16 };
17
18
20 template <typename T> constexpr inline bool always_false_v = always_false<T>::value;
21
22
23
24
29 template <template <typename...> typename Tmpl, typename T> class is_template {
30 private:
31 template <typename... Xs> constexpr static std::true_type test(Tmpl<Xs...>*);
32 template <typename... Xs> constexpr static std::false_type test(...);
33 public:
34 constexpr static inline bool value = decltype(test(std::declval<T*>()))::value;
35 };
36
37
39 template <template <typename...> typename Tmpl, typename T>
40 constexpr static inline bool is_template_v = is_template<Tmpl, T>::value;
41
42
44 template <typename T, template <typename...> typename Tmpl>
46
47
48
49
51 template <typename F, typename R, typename... Args> concept invocable_r = std::is_invocable_r_v<F, R, Args...>;
52}
static constexpr bool value
Definition: concepts.hpp:34
std::integral_constant< decltype(V), V > value
Definition: value.hpp:12
constexpr bool always_false_v
Definition: concepts.hpp:20