Boost logo

Boost :

From: corwinjoy (cjoy_at_[hidden])
Date: 2002-01-08 17:54:00


--- In boost_at_y..., Carl Daniel <cpdaniel_at_p...> wrote:
> From: "David Abrahams" <david.abrahams_at_r...>
> > From: "corwinjoy" <cjoy_at_h...>
> >
> > > I think it would be nice to try to come to some agreement on a
family
> > > of solutions for this.
> >>
> > > 1. After the container is first sorted, is it the container's
job or
> > > the user's job to sort it if elements are later added or
removed?
> >
> > I want to at least have an interface available which lets me
say, "I know
> > what I'm doing; put this /here/, and don't waste any time
> > verifying/re-sorting".
>
> Agreed. In my implementation, I provided the normal std::map/set
insert operations, which maintained sorted order. A
> client could do un-sorted inserts by directly accessing the
underlying sequence (vector) and (if necessary) re-sorting
> to restore the invariant.
>

I like the idea of having an additional interface to provide an
unverified sort. IMO, the the normal std::map insert type interface
should, however, be checked/sorted to make the container more
compatible as a substitute for std::map.


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