2 ms·
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/range/reference
by plorkyeran 14y ago
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/range/reference/ranges/any_range.html 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.