From: Jan Gaspar (jano_gaspar_at_[hidden])
Date: 2004-03-05 08:37:10
> > 1. your rationale mentions many characteristics
> > I would expect of
> > std::deque. Do you have any idea
> > how big the performance difference is?
> The memory is allocated at once, that's the biggest
> What I'm looking for is some more evidence that the
> data structure is really
> faster. I think that
> is relevant since that is your reason d'etre (or
> something, I never took
> French in highschool :-) )
> for the container.
I agree with Pavel. Moreover you would have no control
over iterator invalidation in std::deque.
> > 2. You mention "Guarantee of basic exception
> > as a design criteria. I
> > would expect many operations
> > to have a stronger guarantee.
> Of cource, some methods provide stronger guarantee,
> but in general the container povides just basic
> exception safety. For some methods (e.g. insert) it
> impossible to provide stronger guarantees.
> I guess I would like to know the exact guarantee of
> each function. It will
> be important
> for eg. when I have to provide a pointer version of
> circular_buffer for my
> smart containers.
Ok, agree. Every method will have statement about its
exception safety guarantee in the documentation.
> > 4. Type Requirements: don't T need to be
> > too?
> Just no!
> Then how is an element overwritten?
Look at the replace() method in the source code.
> > 7. when you state contracts like
> > Precondition:
> > *(this).size() > index
> > don't you mean (*this).size() ? I would prefer
> > you omitted this
> > entirely.
> This is just typo. Anyway I would retain the
> yes, I'm not talking about removing the
> precondition. I just don't think
> 'this->' adds
> anything. size() > index would be fine to me.
> > 8. maybe you should add const_pointer data() const
> It is not possible. data() is mutating operation.
> the source code.
> ok. then maybe one should get more hints about this
> mutation (I did not have
> a clue), maybe like
> foo( &*c.begin() );
There are some words regarding iterator invalidation
in the method documentation.
> And what complexity does it involves (linear, I
Do you Yahoo!?
Yahoo! Search - Find what youre looking for faster
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk