TBH, C++ has changed so much that any opinion from 2007 isn't worth much today, and that applies no matter if you think C++ got better or worse since then ;)
Furthermore the boost features used in the "better" example are now standard parts of the language and niether example looks good relative to "modern" C++17. (Though new problems have been introduced too, e.g. overuse of `auto`.)
Valid only in the sense of “we can improve on this old way of doing things.” Not valid in the sense that using boost for foreach and function objects would make absolutely no sense since C++11 which has those features built in, and with cleaner syntax.