(Cpp) move all arguments to deal with side-effects affecting other arguments (closes #2918)