c++ foreach support