sparrow 0.3.0
Loading...
Searching...
No Matches
sparrow::mpl::callable_type_predicate Concept Reference

Matches types whose instance can be called with an object representing a type to evaluate it. More...

#include <mp_utils.hpp>

Concept definition

template<class P, class T>
concept sparrow::mpl::callable_type_predicate = std::semiregular<std::decay_t<P>>
and (
requires(std::decay_t<P> predicate)
{
{ predicate(typelist<T>{}) } -> std::convertible_to<bool>;
}
or
requires(std::decay_t<P> predicate)
{
{ predicate(std::type_identity_t<T>{}) } -> std::convertible_to<bool>;
}
)
Matches types whose instance can be called with an object representing a type to evaluate it.
Definition mp_utils.hpp:156
A sequence of types, used for meta-programming operations.
Definition mp_utils.hpp:55

Detailed Description

Matches types whose instance can be called with an object representing a type to evaluate it.

The object passed to calling the predicate instance is either a typelist with one element or std::type_identity_t<T>. Basically a value wrapper for representing a type. This is useful to detect type predicates which allow being called like normal functions.

Definition at line 156 of file mp_utils.hpp.