Replaced use of lambda with defaulted argument as MSVC + GCC wouldn't accept it.