36 template <
class L,
template <
class...>
class U>
41 template <
template <
class...>
class L,
template <
class...>
class U,
class... T>
42 requires std::is_same_v<L<T...>, U<T...>>
49 template <
class T,
template <
class...>
class U>
69 template <
class... Ts,
class... Us>
86 template <
class... Ts,
class... Us>
101 template <
class TypeList,
class... Us>
106 template <
class... T>
116 template <
typename TList>
121 template <
class From,
template <
class...>
class To>
124 template <
template <
class...>
class From,
template <
class...>
class To,
class... T>
134 template <
class From,
template <
class...>
class To>
141 template <
template <
class...>
class W,
class T>
146 template <
template <
class>
class P,
class T>
148 { P<T>::value } -> std::convertible_to<bool>;
155 template<
class P,
class T >
165 {
predicate(std::type_identity_t<T>{}) } -> std::convertible_to<bool>;
172 template <
class T,
template <
class>
class P>
181 template <
class T, callable_type_predicate<T> P>
184 if constexpr (
requires(std::decay_t<P> p) {
192 return predicate(std::type_identity_t<T>{});
208 template <
template <
class...>
class W,
class X>
212 return std::same_as<T, X>;
217 template <
template <
class>
class P>
220 template <
template <
class...>
class W,
class T>
230 template <
template <
class>
class P>
242 template <
class Predicate,
template <
class...>
class L,
class... T>
243 requires any_typelist<L<T...>> and (callable_type_predicate<Predicate, T> && ...)
244 [[nodiscard]]
consteval bool any_of(L<T...>, [[maybe_unused]] Predicate
predicate = {})
252 template <
template <
class>
class Predicate,
template <
class...>
class L,
class... T>
253 requires any_typelist<L<T...>> and (ct_type_predicate<Predicate, T> && ...)
254 [[nodiscard]]
consteval bool any_of(L<T...> list)
262 template <
class Predicate,
template <
class...>
class L,
class... T>
263 requires any_typelist<L<T...>> and (callable_type_predicate<Predicate, T> && ...)
276 template <
template <
class>
class Predicate,
template <
class...>
class L,
class... T>
277 requires any_typelist<L<T...>> and (ct_type_predicate<Predicate, T> && ...)
278 [[nodiscard]]
consteval bool all_of(L<T...> list)
284 template <
class V, any_typelist L>
293 template <
class Predicate,
template <
class...>
class L,
class... T>
294 requires any_typelist<L<T...>> and (callable_type_predicate<Predicate, T> && ...)
298 auto check = [&](
bool match_success)
319 template <
template <
class>
class Predicate,
template <
class...>
class L,
class... T>
320 requires any_typelist<L<T...>> and (ct_type_predicate<Predicate, T> && ...)
321 [[nodiscard]]
consteval std::size_t
find_if(L<T...> list)
328 template <
class TypeToFind, any_typelist L>
329 [[nodiscard]]
consteval std::size_t
find(L list)
336 template <
template <
class...>
class F,
class... L>
339 static_assert(
dependent_false<L...>::value,
"transform can apply to typelist-like types only");
342 template <
template <
class...>
class F,
template <
class...>
class L,
class... T>
348 template <
template <
class...>
class F,
template <
class...>
class L1,
class... T1,
template <
class...>
class L2,
class... T2>
361 template <
template <
class>
class F,
class... L>
375 template <
typename T,
bool is_const>
378 using type = std::conditional_t<is_const, const T, T>;
381 template <
typename T,
bool is_const>
384 using type = std::conditional_t<is_const, const T&, T&>;
389 template <
class T,
bool is_const>
407 && std::same_as<iter_const_reference_t<T>, std::iter_reference_t<T>>;
430#if defined(_MSC_VER) && !defined(__clang__)
433 __builtin_unreachable();
438 template <
class BoolRange>
440 && std::convertible_to<std::ranges::range_value_t<BoolRange>,
bool>;
445 concept boolean_like = std::is_assignable_v<std::add_lvalue_reference_t<std::decay_t<T>>,
bool>
446 and
requires {
static_cast<bool>(std::declval<T>()); };
449 template <
class From,
class To>
450 concept convertible_ranges = std::convertible_to<std::ranges::range_value_t<From>, std::ranges::range_value_t<To>>;
453 template <
typename T>
457 template <
typename T>
459 || std::derived_from<T, std::unique_ptr<typename T::element_type>>;
462 template <
typename T>
466 template <
typename T>
468 || std::derived_from<T, std::shared_ptr<typename T::element_type>>;
471 template <
typename T>
475 template <
typename T>
480 concept testable =
requires(T t) { t ? true :
false; };
483 template <
typename T,
typename Y,
template <
typename>
typename Qualifier>
488 template <
class CLS,
class... ARGS>
500 template <
class CLS,
class T>
503 static constexpr bool value = !std::is_same_v<CLS, std::remove_cvref_t<T>>;
506 template <
class CLS,
class... ARGS>
519 template <
typename I,
typename T>
521 && std::same_as<typename std::iterator_traits<I>::value_type, T>;
526 concept char_like = std::same_as<T, char> || std::same_as<T, std::byte> || std::same_as<T, uint8_t>;
529 template <
typename T>
531 typename std::remove_cvref_t<T>::value_type;
532 requires std::same_as<
533 std::array<typename std::remove_cvref_t<T>::value_type, std::tuple_size<std::remove_cvref_t<T>>::value>,
534 std::remove_cvref_t<T>>;
538 template <
typename T>
540 typename std::remove_cvref_t<T>::element_type;
541 requires std::tuple_size_v<T> != std::dynamic_extent;
542 requires std::same_as<
543 std::span<typename std::remove_cvref_t<T>::element_type, std::remove_cvref_t<T>::extent>,
544 std::remove_cvref_t<T>>;
Matches any type which is an instance of typelist.
Matches range types whose elements are convertible to bool.
Matches types that can be convertible to and assignable from bool.
Matches types whose instance can be called with an object representing a type to evaluate it.
Represents a constant iterator.
The constant_range concept is a refinement of range for which ranges::begin returns a constant iterat...
Matches range types From whose elements are convertible to elements of range type To.
Matches template types that can be evaluated at compile-time similarly to std::true/false_type This m...
Concept to check if an iterator is of a specific type.
Matches template types which can be used as type-wrappers for evaluation in type-predicates.
consteval bool all_of(L< T... >, Predicate predicate)
Checks that every type in the provided list of is making the provide predicate return true.
consteval bool contains(L list)
consteval bool any_of(L< T... >, Predicate predicate={})
Checks that at least one type in the provided list of is making the provide predicate return true.
consteval bool evaluate(P< T >)
Evaluates the provided compile-time template class predicate P given a type T, if P is of a similar s...
decltype(append(TypeList{}, Us{}...)) append_t
Appends one or more types or typelist to a given TypeList.
std::common_reference_t< const std::iter_value_t< T > &&, std::iter_reference_t< T > > iter_const_reference_t
Computes the const reference type of T.
consteval std::size_t find_if(L< T... >, Predicate predicate)
constexpr std::size_t size(typelist< T... >={})
consteval auto append(typelist< Ts... >, Us...)
Appends the given types to a typelist.
consteval auto as_predicate()
constexpr bool excludes_copy_and_move_ctor_v
constexpr bool is_type_instance_of_v
true if T is a concrete type template instanciation of U which is a type template.
void unreachable()
Invokes undefined behavior.
typename constify< T, is_const >::type constify_t
typename impl::rename_impl< From, To >::type rename
Changes the type of the list to the given type/ Example: static_assert(std::same_as<rename<typelist<i...
consteval std::size_t find(L list)
typename add_const_lvalue_reference< T >::type add_const_lvalue_reference_t
typename impl::transform_impl< F, L... >::type transform
Applies the metafunction F to each tuple of elements in the typelists and returns the corresponding l...
std::conditional_t< is_const, const T &, T & > type
std::conditional_t< is_const, const T, T > type
consteval bool operator()(W< T >) const
Workaround to replace static_assert(false) in template code.
static constexpr bool value
static constexpr bool value
static constexpr bool value
Compile-time type predicate: true if the evaluated type is the same as T.
consteval bool operator()(W< X >) const
A sequence of types, used for meta-programming operations.