Question.14
A developer must choose between a function pointer and a lambda for a driver callback. The callback needs to access a local threshold variable.
Select Answer
Function pointer -- it can capture local variables
Lambda with capture -- function pointers cannot carry state; a capturing lambda bundles the threshold value with the callback code, eliminating void* context hacks
Both work equally well
Neither -- use a global variable instead