On Fri, May 6, 2011 at 6:51 PM, Evan Driscoll <driscoll@cs.wisc.edu> wrote:
On 05/06/2011 11:59 AM, Jeff Flinn wrote:
You might google any_iterator, and see how other authors have addressed
similar problems.

Great! I tried to find someone who had done something similar, figuring I couldn't have been the first, but all the search terms I tried were too generic.

Thanks,
Evan


Evan,

For the Boost 1.46 release I added two related features to Boost.Range. The two related features are 'any_range' and the Range Adaptor 'type_erased'. These implementations take the any_iterators that you will find commonly on the web and improve their performance by incorporating the 'small buffer optimization' which radically reduces the allocation overhead and improves the locality of data. Hence the performance overhead of this particular implementation is considerably less than others that I have tried.

I strongly recommend using the any_range solution rather than redeveloping any_iterators.

The relevant reference documentation:
http://www.boost.org/doc/libs/1_46_1/libs/range/doc/html/range/reference/ranges/any_range.html
http://www.boost.org/doc/libs/1_46_1/libs/range/doc/html/range/reference/adaptors/reference/type_erased.html

I hope this saves you some time.

Regards,
Neil Groves

 
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users