This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Implementation of vector<my_own_class> like vector<bool>
- To: libstdc++@sourceware.cygnus.com
- Subject: Implementation of vector<my_own_class> like vector<bool>
- From: Rainer Dorsch <rainer@rainer.informatik.uni-stuttgart.de>
- Date: Fri, 03 Sep 1999 19:32:00 +0300
- cc: gosho@ramona.informatik.uni-stuttgart.de
- Reply-To: rainer.dorsch@informatik.uni-stuttgart.de
We want to implement a vector class for our own class my_own_class, i.e. not
the standard STL vector-template should be used when instantiating
vector<my_own_class>
but our own implementation (as it is done in vector<bool>). More specific our
own class consists of 2 bit of information (0,1,-) and we have to store a
vector of it in a specific representation to use the bit level parallelism of
a CPU.
Our questions:
1. Is there a good manual which describes how to do this (we have Stroustoup's
introduction book) or a good manual for implementing STL compatible classes in
general.?
2. We looked in the STL source code of vector<bool> in libstdc++2.10, but it
is hard to understand the global picture, although we understand each line of
code. Has anybody written a simple example vector<xyz> implementation, which
is easier to understand?
Thanks a lot!
--
Rainer Dorsch
Abt. Rechnerarchitektur e-mail:rainer.dorsch@informatik.uni-stuttgart.de
Uni Stuttgart Tel.: 0711-7816-215