Replaced BOOST_FOREACH with C++11 syntax