cpp-toolbox  0.0.1
A toolbox library for C++
Loading...
Searching...
No Matches
toolbox::traits::is_callable< T, typename > Struct Template Reference

检查类型是否可调用/Check if type is callable More...

#include <type_traits.hpp>

Inheritance diagram for toolbox::traits::is_callable< T, typename >:

Detailed Description

template<typename T, typename = void>
struct toolbox::traits::is_callable< T, typename >

检查类型是否可调用/Check if type is callable

Template Parameters
T要检查的类型/Type to check
voidSFINAE参数/SFINAE parameter
// 检查lambda是否可调用/Check if lambda is callable
auto lambda = []() { return 42; };
static_assert(is_callable<decltype(lambda)>::value);
// 检查函数对象是否可调用/Check if function object is callable
struct Functor { void operator()() {} };
static_assert(is_callable<Functor>::value);
检查类型是否可调用/Check if type is callable
Definition type_traits.hpp:277

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