Subject: Re: [boost] [utility] auto_buffer v2
From: Matt Calabrese (rivorus_at_[hidden])
Date: 2009-03-05 11:20:50
On Thu, Mar 5, 2009 at 3:56 AM, Thorsten Ottosen <
> As one can see from my code, swap and copy-operations are difficult to
> implement. Especially swap. Therefore such an allocator will be *very*
> difficult to use correctly in a container. In particular, swap() sometimes
> only gives the basic guarantee (and no better guarantee is possible!).
I haven't given it too much thought, but intuitively (perhaps naively on my
part), it seems to me like if the types you are instantiating the template
with have no-throw copy/copy-assign/swap operations you could satisfy the
strong guarantee for the associated auto_buffer operations regardless of if
neither, one, or both operands store their data in a separate allocation.
-- -Matt Calabrese