
20 Apr
2010
20 Apr
'10
10:10 p.m.
On 20/04/2010 17:46, Thorsten Ottosen wrote:
Hi Ion,
I think the above member could be useful (taking an already sorted sequence), especially if the container needs to reallocate, in which case we may merge the two sequences
[begin,end) [lower_bound(*begin),upper_bound(*(end-1))]
and copy the unaltered prefix and suffix.
But we don't know the final size of the the container without comparing each value to be inesrted, what's your suggestion? And should the input sequence contain unique values for set/map?
Furthermore, even when we don't have to reallocate, we can bulk copy the suffix and simulate merging for the infix range.
The question is how we know we don't need to reallocate. Best, Ion