Boost logo

Boost :

From: Joaquín Mª López Muñoz (joaquin_at_[hidden])
Date: 2003-11-06 10:46:25


Hi Jason,

Jason House ha escrito:

> Joaquín Mª López Muñoz wrote:
>
> > I'm far more interested in knowing whether the library is perceived
> > as useful / worth asking a formal review for.
>
> I think that your library is very useful. Your library was my
> motivation to finally start trying to use boost libraries... I have a
> tendency to do simulation of/retracing communications. I end up needing
> to match data structures by some key as well as a timestamp (for
> timeouts etc...)
>

Thank for your itnerest in the library! Please give it a try, I'm most interested
in knoing how simple/convenient its usage is.

>
>
> Well, I went through your docs for the first time the other day. One
> of the first things I did do was take a look at quick_reference.html and
> found a lot of TO DO's.

quick_reference.html is not an official part of the docs yet (it is not
reachable from index.html.) I'm deciding on a suitable format to
convey as much useful info as possible for those who do not want
to delve in the reference, whose "C++ standard" style can be a
little hard to grasp.

>
> I've had some confusion about iterators... What I see in the docs
> doesn't seem to use any template parameters for the iterators. Since
> there can be multiple indicies I suspect that template parameters have
> to work there way into the iterator type, begin, end, etc...
>

indexed_set is used through the interfaces of their indices. Each of these
indices have their own iterators and set-like methods. An iterator
obtained from say index #0 is a different type than one coming from
index #1. For instance:

typedef indexed_set<..> my_indexed_set;
my_indexed_set s;

my_indexed_set::iterator_type<0>::type it =s.get<0>().begin(); // returns iterator
to the index #0
my_indexed_set::iterator_type<1>::type it =s.get<1>().end(); // returns iterator
to the index #1

Also, my_indexed_set::iterator_type<N>::type is the same as
my_indexed_set::index_type<N>::type::iterator.

I don't know if this answers your question. May I suggest you take a look
at the examples section, where practical cases can be found on how to access and
use the diferent indices and iterators of an indexed_set.

Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk