for_each correctly returns InputIterator

Fixes #33