Boost logo

Boost :

From: JOAQUIN LOPEZ MU?Z (joaquin_at_[hidden])
Date: 2006-01-21 06:27:04


----- Mensaje original -----
De: David Abrahams <dave_at_[hidden]>
Fecha: Sábado, Enero 21, 2006 3:54 am
Asunto: Re: [boost] [multi_index] intrusive multi_index poll for
interest

> "JOAQUIN LOPEZ MU?Z" <joaquin_at_[hidden]> writes:
>
> >> > I will need another member function to return the
> >> > position ordinal of a given element (that is,
> >> > the inverse of operator[]), and for that "position"
> >> > seems also a good candidate.
> >>
> >> IMO that should have been "index."
> >
> > But "index" already has a disparate meaning in the
> > context of Boost.MultiIndex.
>
> I'm not sure that's a problem. But if it is, maybe you should rename
> the library. I'm only half-kidding: if you can't use index to mean
> what it usually means in the most basic computer programs, it
> feels to
> me like something is wrong.

Well, choosing names for a library is like having a tattoo
made, in so many ways --one has to live on bearing
the errors of their youth. Seriously, it's not only
the name of the lib, "index" is also part of some names
of the API and changing those would break users' code.

>
>
> > I need another synonim:
> > ordinal, rank, situation?
>
> I would use ordinal if I had to pick one of those.
>

So we'd have

iterator position(const value_type& x)const;
size_type ordinal(const value_type& x)const;

Isn't this a little hard to discern? Maybe the
following is less confusing:

iterator iterator_to(const value_type& x)const;
size_type position(const value_type& x)const;

Better?

Joaquín M López Muñoz
Teléfó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