Boost logo

Boost :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2003-12-24 07:05:17


Hi Jason

----- Mensaje original -----
De: Jason House <jhouse_at_[hidden]>
Fecha: Miércoles, Diciembre 24, 2003 3:09 am
Asunto: [boost] Re: Formal Review Request: Boost.IndexedSet
[snip]
> > I believe he means multiple index types as in, for example, a hash
> > table index in addition to the existing tree index.
> >
> > [snip]
>
> You are correct. (sorry for the late follow up)
> It would be really nice if items like moving from a tree index to
> a hash
> index simply involved changing a single line of code... the
> typedef
> indexed_set<...> definition. I think this is a doable goal for a
> more
> standard set of index types, but might require going through the
> motions
> of trying to fit other index types in the same API before
> misnomers and
> other difficulties in the API pop up.
>

I'm afraid that, taken literally, your proposal is
neither convenient nor doable. Let me explain myself: if
you've got two different indexes with the *very same* interface,
what's the difference between them? Complexity guarantees?
Let's take indexed_set aside for a moment: a hash_set *is not*
an std::set, so it is natural that their interfaces differ.
For instance, since hash_set (as implemented in say
http://www.sgi.com/tech/stl/hash_set.html) does not sort
its elements, you don't have lower_bound.
That said, it is generally desireable that common functionality
is provided through the same interface (for example,
hash_set and std::set both being containers, the provide
begin() and end() ).
I'm not sure if this addresses your question. In case
it doesn't, please tell me so.

PS. I'd appreciate if someone can run the test cases
in MSVC++ 6.5 *release mode*. It works OK in my machine, but
Pavel reports crashes for that configuration on his box,
so I'd like to have a third opinion.

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