the rename function is not available in the foreach format in cpp: for(int val:valueList) {} instead it is replaced by 'refactor' menu, asking to rename iterator::operator*