Please use `const std::function<>&` for `afterCaptured` parameter.