Use for-range-loop with c++11

- use for-range-loop instead of BOOST_FOREACH if available