cmoon::meta::type_list<Types...>::can_find





template<template<typename> class Predicate>
[[nodiscard]] static constexpr bool can_find() noexcept;


(1)

Checks if it is well-formed to call find with the given predicate.

Parameters

(none)

Return value

true if it is well-formed to call find on this type_list with the given Predicate, false otherwise.

Exceptions

This function never throws exceptions

Complexity

Constant.

Example



import <type_traits>;

import cmoon.meta;

int main()
{
    using tl = cmoon::meta::type_list<int, long, char>;

    static_assert(tl::can_find<std::is_integral>());
    static_assert(!tl::can_find<std::is_floating_point>());
}