On 2015-08-09 21:58, Thiago Macieira wrote:
> On Monday 10 August 2015 02:36:20 Kevin Kofler wrote:
>> realloc doesn't work if you are inserting or removing in the middle of a
>> vector.
> 
> Sure it does. It's required if you need to insert anywhere but don't have 
> enough space.
> 
> Now, if you're not appending to the end, you'll need to memmove elements 
> around, sure. But that's a second step.

If you are doing both, isn't it more efficient to allocate and do two
partial memmove's rather than doing a realloc? (In the case that you
can't do an in-place realloc, that is...)

...that would require a try_realloc though...

-- 
Matthew

_______________________________________________
Development mailing list
Development@qt-project.org
http://lists.qt-project.org/mailman/listinfo/development

Reply via email to