Boost logo

Boost :

Subject: Re: [boost] [utility] new auto_buffer class --- RFC
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-03-02 23:18:42


AMDG

Thorsten Ottosen wrote:
>> Certainly swap should be provided somehow; a fast-as-possible swap is
>> not otherwise possible since the user can't get at the buffer pointer.
>> boost::array supports swap, and yours should be at least as fast as
>> that. On that precedent I'd say you should support swap() under that
>> name. Has anyone ever complained about the deceptive slowness of
>> boost::array's swap?
>
> I don't know. I just stay clear of it. The point is that we don't want
> inexperienced users to use an O(n) swap accidently.

Please define n. The cost is bounded by the stack
capacity, rather than the actual size.

In Christ,
Steven Watanabe


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk