Quick A: A lot. They can bind to anything callable, not just functions. And they can perform conversions on parameter and return types.
Is there a use case for std::function that is not covered by function pointers, or is it just syntactic sugar?
The notation for
std::function
is quite nice when compared to function pointers. However, other than that, I can't find a use case where it couldn't be replaced by pointers. So is it just syntactic sugar for function pointers?
Add a Comment
Comments are closed.