edd / opqit
A C++ iterator that can be used to wrap any existing iterator type in order to reduce header include dependencies.
opqit
opqit is a library that supplies a template class opqit::opaque_iterator<> that allows you to wrap any standard C++ iterator.
This has two uses:
- it can significantly reduce compile-time header dependencies. Think of
opaque_iteratoras an implementation of the pimpl idiom for iterators - it can restrict the interface of existing iterator objects; perhaps you want to expose the iterators of a
std::vector<X>member object, but as forward iterators, rather than random access iterators.
opqit has no dependencies other than the C++ standard library and to use it, you need only to #include opqit's headers. The tests, examples and benchmarks supplied with the library do need to be compiled, however.
opqit is released under the Boost Software License v1.0, making it available for use in both closed- and open-source software.
- A motivating example
- Using opqit
- Compiler support
- Benchmarks
- Compiling the tests, benchmarks and examples
See also
- On the Tension Between Object-Oriented and Generic Programming in C++ by Thomas Becker
- Adobe's
any_iterator
This revision is from 2009-11-27 12:43
