libwrapiter 1.0.0 review
Downloadlibwrapiter is a library that provides wrappers for C++ STL style iterators. It makes it easy to define generic iterator wrappers,
|
|
libwrapiter is a library that provides wrappers for C++ STL style iterators.
It makes it easy to define generic iterator wrappers, which remove the need to expose underlying data structures when working with classes using STL containers.
Purpose:
Consider the following massively oversimplified example. We're using the private implementation pattern or pimpl to avoid sticking too much in the header files.
myproject/myclass.hh without libwrapiter
#include < list >
namespace myproject
{
class MyClass
{
private:
///name implementation data, using the 'private implementation' pattern
///{
struct Implementation;
Implementation * _imp;
///}
///name disallow copying and assignment
///{
MyClass(const MyClass &);
const MyClass & operator= (const MyClass &);
///}
public:
MyClass();
~MyClass();
///name iterate over our items
///{
typedef std::list::const_iterator Iterator;
Iterator begin() const;
Iterator end() const;
///}
};
}
What's New in This Release:
This relase is exception safe: no memory will be leaked if an underlying iterator's constructor or destructor throws.
A wider range of output iterators are supported.
libwrapiter 1.0.0 keywords