
On 10/5/07, François Duranleau <duranlef@iro.umontreal.ca> wrote:
Yes, of course. I was mostly pointing out a difference from what we are used to in STL. I see no reason why it should be different, and it would actually be trivial to add the accessor.
(There was a typo in my reply to your post, but I think the code was still understandable) Sorry, I mistook your original post as wondering "how and why", not just "why", and given that I didn't know "why", I answered "how". I agree, it would be nice if it was (almost) idiomatic, and you could do something like: averager total = kdtree.within_bounds(bounds, boost::make_function_output_iterator(averager())).function; total.avg /= total.num; within_bounds would have to return the OutputIterator if it was to remain generic, and at the call site you would need to access it's function object, just like you suggested. I guess we'll have to wait for a developer response as to why it was implemented the way it was... --Michael Fawcett