
19 Nov
2007
19 Nov
'07
10:12 p.m.
Eric Niebler wrote: ...
There are some surprisingly thorny issues wrt range-based algorithms, which I list in the appendix of the range_ex docs. In particular, does an "output range" make sense? Range_ex uses output iterators instead of output ranges. At the time, I thought that was unsatisfactory. Less so now, but it's still an open issue.
What's the issue with returning a range? How else can they be chained? What is your opinion of this style of algorithm? template<typename out_t, typename in_t> inline out_t algorithm (in_t const& in) { out_t out (boost::size (in)); assuming output size same as input do_something_with(in) return out; } This assumes return value optimization, which I've verified on recent gcc.