const char* to string& in generated code