The array stores pointers, so the arguments of your lambda function needs to be pointers, not references.