This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Implementation of vector<my_own_class> like vector<bool>



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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]