You don't need to copy P0 into a temporary object with the function object version either: a reference member can be used instead. Remember, a lambda is syntactic sugar that results in a function object.Originally Posted by C_ntua
No, it does not have to be global: C_ntua's example looks correct in that regard because of the & in the capture list.Originally Posted by whiteflags