Added foreach snippet for C++