Sorry, my bad, I had the '&' in the wrong place! In a lambda capture list, when declaring a variable to be captured by reference, the '&' needs to be in front of the variable name instead of behind it: