Can you help me resolve this compiler error?
template
static void ComputeGenericDropCount(function func)
{
T::ForEach(
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<void(Npc *, int)>& func)