On 09/08/2009 23:00, rgheck wrote:
On 08/09/2009 03:11 PM, Abdelrazak Younes wrote:
On 09/08/2009 21:09, rgheck wrote:
On 08/09/2009 03:08 PM, Abdelrazak Younes wrote:
On 09/08/2009 21:00, Vincent van Ravesteijn wrote:
Basically we think it's a bit lazy to start moving around paragraphs without ensuring that a decent buffer is set. Moreover, I think that we should do it only at one place. That place would be somewhere in CutAndPaste. There is no other reason than pasting that the buffer should get invalidated.

I see. Then someone needs the fix all cases where something is copied.

That was the intention. I guess we missed a few....

I'm still puzzled about swap().

    void swap(_Ty& _Left, _Ty& _Right)
    {    // exchange values stored at _Left and _Right
    if (&_Left != &_Right)
        {    // different, worth swapping
        _Ty _Tmp = _Left;

        _Left = _Right;
        _Right = _Tmp;
        }
    }

See?

You are maybe confusing with container swapping, which is something else that we should probably use in this case.

Yes, I was, specifically with RandomAccessList::swap(), which shouldn't make a copy, right?

You mean the swap method that I just created for that purpose? Yes, indeed ;-)


In any event, avoiding a copy here is worth doing, I'd assume. Indeed, part of what moving that routine out of setBuffer does is reveal places where we're making unnecessary copies.

Right.

Abdel.

Reply via email to