[C++11] Use foreach iterator for blocks and operands