23 template <
class Derived,
class Base>
24 concept derived_from = std::is_base_of_v<Base, Derived> &&
25 std::is_convertible_v<const volatile Derived*, const volatile Base*>;
35 template<
typename F,
typename... Args>
37 { std::invoke(f, std::forward<Args>(
args)...) };
40 template <
class From,
class To>
41 concept convertible_to = std::is_convertible_v<From, To> &&
requires {
42 static_cast<To
>(std::declval<From>());
46 concept destructible = std::is_nothrow_destructible_v<T>;
48 template <
class T,
class... Args >
49 concept constructible_from = destructible<T> && std::is_constructible_v<T, Args...>;
51 template<
typename _Tp>
52 concept move_constructible = constructible_from<_Tp, _Tp> && convertible_to<_Tp, _Tp>;
55 concept copy_constructible = move_constructible<T> &&
56 constructible_from<T, T&> &&
57 convertible_to<T&, T> &&
58 constructible_from<T, const T&> &&
59 convertible_to<const T&, T> &&
60 constructible_from<T, const T> &&
61 convertible_to<const T, T>;
64 template<
class T,
class U >
65 concept SameHelper = std::is_same_v<T, U>;
68 template<
class T,
class U >
69 concept same_as = detail::SameHelper<T, U> && detail::SameHelper<U, T>;
73 template <
class T,
class U >
74 concept common_reference_with = same_as<std::remove_reference_t<T>, std::remove_reference_t<T>> &&
75 convertible_to<T, std::remove_reference_t<U>> &&
76 convertible_to<U, std::remove_reference_t<T>>;
78 template<
class LHS,
class RHS >
79 concept assignable_from = std::is_lvalue_reference_v<LHS> &&
80 common_reference_with<const std::remove_reference_t<LHS>&,
81 const std::remove_reference_t<RHS>&> &&
82 requires(LHS lhs, RHS&& rhs) {
83 { lhs = std::forward<RHS>(rhs) } -> std::same_as<LHS>;
87 requires(T& a, T& b) {
93 concept movable = std::is_object_v<T> &&
94 move_constructible<T> &&
95 assignable_from<T&, T> &&
99 concept copyable = copy_constructible<T> &&
101 assignable_from<T&, T&> &&
102 assignable_from<T&, const T&> &&
103 assignable_from<T&, const T>;
106 concept default_initializable = constructible_from<T> &&
108 requires { ::new T; };
112 concept semiregular = copyable<T> && default_initializable<T>;
115 concept regular = semiregular<T>;
118 concept incrementable = regular<I> &&
requires(I i) {
119 { i++ } -> std::same_as<I>;
123 template<
typename F,
typename... Args>
124 concept predicate =
requires(F&& f, Args&&...
args) {
125 { f(std::forward<Args>(
args)...) } -> same_as<bool>;
130 template<
typename F,
typename From,
typename To>
131 concept mapper =
requires(F&& f, From&& from) {
132 { std::invoke(f, std::forward<From>(from)) } -> aui::convertible_to<To>;
135 template<
typename F,
typename ProducedObject>
136 concept factory =
requires(F&& f) {
137 { std::invoke(f) } -> aui::convertible_to<ProducedObject>;
147 concept unsigned_integral = std::is_unsigned_v<T>;
Concept shortcut to std::is_arithmetic_v.
Definition: concepts.h:144
Invokable concept.
Definition: concepts.h:36
API_AUI_CORE const ACommandLineArgs & args() noexcept
Definition: OSAndroid.cpp:29