Clone wiki

opqit / Home


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:

  1. it can significantly reduce compile-time header dependencies. Think of opaque_iterator as an implementation of the pimpl idiom for iterators
  2. 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.

See also