Utopia 2
Framework for studying models of complex & adaptive systems.
|
Test whether an object is callable. More...
#include <monitor.hh>
Static Public Member Functions | |
template<class U > | |
static auto | test (U *p) -> decltype((*p)(std::declval< Args >()...), void(), std::true_type()) |
template<class U > | |
static auto | test (...) -> decltype(std::false_type()) |
Static Public Attributes | |
static constexpr bool | value = decltype(test< F >(0))::value |
Test whether an object is callable.
is_callable returns true for callable functions such as std::functions or lambdas. However, it returns false if an object only provides an operator(). This is necessary because otherwise types such as int or double would also return true (for this case use std::is_callable).
F | The function |
Args | The function arguments |
|
static |
|
static |
|
staticconstexpr |