Это не компилируется, по крайней мере, с g ++ 4:
foo.cpp: In function ‘int main()’:
foo.cpp:16: error: invalid initialization of non-const reference of type ‘std::string&’ from a temporary of type ‘std::string’
foo.cpp:10: error: in passing argument 1 of ‘void mutate(std::string&)’
(Номера строк отключены на 3 или 4, потому что мне пришлось добавить строки #include и 'using'.)
Итак, ваш компилятор не такой строгий, как должен быть.