
3 Mar
2009
3 Mar
'09
4:18 a.m.
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