SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
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");
"Failed testing type trait is_callable");
static_assert(not tt::is_callable<B>::value,
"Failed testing type trait is_callable");
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:
  • src/Utilities/TypeTraits/IsCallable.hpp