News for hackers. Stuff that matters.
Re:An Idiot's Guide to C++ Templates - Part 1 by plorkyeran on Tuesday April 23, 2013 @09:20AM (#5594914)
any_range covers the use-case of a generic iterator that doesn't care about the source: http://www.boost.org/doc/libs/1_53_0/libs/range/doc/html/ran...

In practice, it's not really useful all that often. It has non-zero overhead so it's not good default choice, and you rarely absolutely need it. Most situations where you'd want to return a value then do something with it can be transformed into passing a callback to the function instead, which lets you use a templated operator() to achieve the same result without the runtime overhead.

There are no comments on this comment yet.