C++17 will have a Callable
concept and I was wondering what was exactly the difference with the types for which std::is_function<T>::value
is true
. Are they equivalent? Is one a superset of the other?
C++17 will have a
Callable
concept
It's there in the standard since C++11.
Are they equivalent? Is one a superset of the other?
No, in fact, they are completely disjoint. Callable
applies only to object types, and include everything from pointer-to-members to types with an overloaded operator()
to types with an implicit conversion to function pointers to function pointers themselves.
is_function
is true only for actual function types, which are, by definition, not object types.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With