Work around VC2010 lack of range-based for support

Range-based for is new in VC2012.