SpECTRE  v2024.04.12
tt::is_callable< TT, TArgs > Class Template Reference

Check if a type T is callable, i.e. T(Args...) is evaluable. More...

#include <IsCallable.hpp>

Public Types

using type = std::integral_constant< bool, value >
 std::true_type if callable, std::false_type otherwise
 

Static Public Attributes

static constexpr bool value = decltype(test_callable<TT, TArgs...>(0))::value
 true if callable, false otherwise
 

Detailed Description

template<typename TT, typename... TArgs>
class tt::is_callable< TT, TArgs >

Check if a type T is callable, i.e. T(Args...) is evaluable.

Details

Inherits from std::true_type if TT has the call operator, operator() defined with arguments TArgs..., otherwise inherits from std::false_type.

Usage

For any type TT and types TArgs_i,

Check if a type T is callable, i.e. T(Args...) is evaluable.
Definition: IsCallable.hpp:42

Returns: std::bool_constant

Semantics: If the type TT defines operator() with arguments TArgs..., then

typename result::type = std::true_type;

otherwise

typename result::type = std::false_type;

Example

"Failed testing type trait is_callable");
"Failed testing type trait is_callable");
"Failed testing type trait is_callable");
"Failed testing type trait is_callable");
"Failed testing type trait is_callable");
static_assert(tt::is_callable_v<B, int, double>,
"Failed testing type trait is_callable");
static_assert(not tt::is_callable<B>::value,
"Failed testing type trait is_callable");
typename is_callable< T, Args... >::type is_callable_t
Definition: IsCallable.hpp:71
See also
std::is_callable
Template Parameters
TTthe class to check
TArgsthe args passed to operator()

The documentation for this class was generated from the following file: