Skip to content

Commit

Permalink
Add concept for checking for if T defines operator->()
Browse files Browse the repository at this point in the history
  • Loading branch information
oblivioncth committed Dec 29, 2024
1 parent 2532b87 commit 08ca409
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/utility/include/qx/utility/qx-concepts.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,10 +237,11 @@ concept defines_address_of_s = requires(K klass) {{ &klass } -> std::same_as<R*>
template<class K>
concept defines_address_of = requires(K klass) {{ &klass };};

/* TODO: Not sure how to do this one, there is a "b" parameter but its type could be anything
* template<class K, typename R>
* concept defines_member_ptr_s = requires(K klass, R ret) {{ klass-> } -> std::same_as<R*>;};
*/
template<class K>
concept defines_member_ptr = requires(K klass) {{ klass.operator->() };};

template<class K, typename R>
concept defines_member_ptr_s = requires(K klass) {{ klass.operator->() } -> std::same_as<R*>;};

template<class K, typename R, typename T>
concept defines_ptr_to_member_ptr_for_s = requires(K klass, T type) {{ klass->*type } -> std::same_as<R&>;};
Expand All @@ -267,7 +268,6 @@ concept defines_comma_for_s = requires(K klass, T type) {{ klass, type } -> std:
template<class K, typename T>
concept defines_comma_for = requires(K klass, T type) {{ klass, type };};


// Arithmetic Operators
template<class K>
concept defines_unary_plus_s = requires(K klass) {{ +klass } -> std::same_as<K>;};
Expand Down

0 comments on commit 08ca409

Please sign in to comment.