replace boost foreach with C++11.