Mario F., your suggestion worked perfectly. God knows why, but it did.
Actually, since I've had many, many error related to references based on temporary variables, I don't think I'd be that suprised about the compiler complaining about the 'stmt' reference being an error but, like you say, I have no idea why MSVC++ thought the first parameter was the error...
Thanks for your help though; 'twas wrecking my head