You need to specify how to capture func into the lambda.
[] don't capture anything
[&] capture-by-reference
[=] capture-by-value (copy)
T::ForEach([&](T *what) {
I'd also recommend that you should send func by const reference.
static void ComputeGenericDropCount(const function& func)