From: Michal 'Sektor' Malecki (michalmal_at_[hidden])
Date: 2002-06-04 01:51:00
Please, pay attention, because I am totally out of time.
A derivative from pair of two iterators. Simplifies giving a "range" of items; can
provide creating new algorithms which take whole container instead of two
iterators and can also provide a "virtual container", which is really only a range
As an addition, there is an "integer_iterator" provided which can be used to perform
some algorithm on a numerical range, for example [ivi creates integer-incremental interval]
ivi( 0, 10 ).apply( cout << t[_1] << endl );
Less usable feature; an "object" list. Unlike std::list, it manages objects by reference
and stores by pointer. The object has to be stored into the list, the list can "delete" it
or -- if required -- copy using operator new and copy constructor (if available). This provides
one important difference: no concept (like default-constructible) is required but one: the type
of object, which shall be stored in this list must be derived from olist<T>::node_t. In reward you
receive a very flexible list: it does not create nodes nor allocates memory (that's also
why it does not contain any "allocator" template). The only memory allocated is the
object itself (so only the object itself decides about the memory allocation). Therefore
it can hold very large objects which are managed externally by references. This is
very useful, because you don't need any (*it)->something() to access the object's internals.
It does not provide "insert/push_back/push_front" methods; instead you should
use "store/store_front/store_back" and pass a pointer to stored object.
In C++ you should not use NULL, because it's missing. However C++ would need
some "universal null pointer" value. There is a very simple definition, thanks to which
you have a "null" called symbol, you can assign it into ANY pointer value (if in some
cases it would be impossible, you can use null.cast<TYPE>()), you can compare
some pointer with it, you can pass this symbol as a function argument, if overloaded
for a pointer and an integer, the pointer version is choosen. You can also provide another
"null pointer value" implementation for some type (default is so-called NULL) by
overdefining the empty_pointer_value::cast<Type>().
The sources for these things can be obtained from http://www.kis.p.lodz.pl/~sektor/include
b) sktl_olist.h (some addition in sktl_iterator.h, provides olist-specific store_iterator etc)
And please, foregive me that I unsubscribe from the list, but I receive _A_LOT_ of email,
which is a communication method in our company. The mail excess disturb me in work
and takes too much place and I can't cope with it.
For any questions follow: sektor_at_[hidden]
-- // _ ___ Mee eisenegkees heemas eis peirasmon. Heemeis ouk \\ L_ |/ `| /^\ ,() echomen teen eksousian hyper heemin. // \_ |\ \/ \_/ /\ Michal "Sektor" Malecki <sektor:*)aldec.katowice.pl> --==** Wagi sie nie przywiazuje! Wage sie przykreca! **==--
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk