|
|
|
|
|
by vinkelhake
3798 days ago
|
|
As fleitz says, std::function can do more. It can accept any callable. The delegate is restricted to just calling functions. In particular, it means that the client can't bind any extra parameters which can be really useful. That said, popular implementations of std::function employ small object optimizations so the usescases that delegate supports doesn't incur heap allocations. I would guess that delegate has a slight upper hand when it comes to call performance. I really doubt the difference would matter when used in GUI programming. |
|