
On 27/05/10 15:04, Stewart, Robert wrote:
But even this is not true, as Beman's implementation will do a copy as there is no in-place operations, as you bellow.
I didn't realize I was bellowing about anything and I wasn't the one to introduce the idea of in-place swapping. Nevertheless, copying built-in types is trivial and should lend itself readily to optimization in many cases, so the difference should be small, if not zero.
If I may ask, do you use "Beman's implementation" to refer to copying with unrolled loops? I used the loops approach to craft endian-aware binary streams IO carrying geometry objects, it was for Boost.Geometry, some time ago: http://github.com/mloskot/workshop/blob/master/endian/endian.hpp Best regards, -- Mateusz Loskot, http://mateusz.loskot.net