I do not recommend to pass KSpace by value. Use const KSpace & instead.