Nui
concepts.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <concepts>
4 
5 namespace Nui
6 {
7  template <typename T>
8  concept Numerical = std::integral<T> || std::floating_point<T>;
9 
10  template <typename T>
11  concept Fundamental = Numerical<T> || std::same_as<T, bool>;
12 
13  template <typename T>
14  concept Incrementable = requires(T t) {
15  ++t;
16  t++;
17  };
18 
19  template <typename T>
20  concept Decrementable = requires(T t) {
21  --t;
22  t--;
23  };
24 
25  template <typename T, typename U>
26  concept PlusAssignable = requires(T t, U u) { t += u; };
27 
28  template <typename T, typename U>
29  concept MinusAssignable = requires(T t, U u) { t += u; };
30 
31  template <typename T, typename U>
32  concept InvocableReturns = requires(T func) {
33  {
34  func()
35  } -> std::same_as<U>;
36  };
37 
38  template <typename T>
39  concept Range = requires(T t) {
40  t.begin();
41  t.end();
42  t.cbegin();
43  t.cend();
44  };
45 }
Definition: file_dialog.hpp:6
concept Incrementable
Definition: concepts.hpp:14
requires(IsObservedLike< ObservedValues > &&...) ObservedValueCombinator< std
Definition: observed_value_combinator.hpp:191
concept Fundamental
Definition: concepts.hpp:11
concept MinusAssignable
Definition: concepts.hpp:29
concept Numerical
Definition: concepts.hpp:8
concept Range
Definition: concepts.hpp:39
concept InvocableReturns
Definition: concepts.hpp:32
concept PlusAssignable
Definition: concepts.hpp:26
concept Decrementable
Definition: concepts.hpp:20