Use const_iterator to resolve Visual Studio 2008 compile error

Patch from @patricksnape.
Merge pull request #728 from ariddell/feature/vs2008-iterator

Use const_iterator to resolve Visual Studio 2008 compile error