
26 May
2010
26 May
'10
7:43 p.m.
Hi Rob Thanks for the positive comments.
I have versions that return a swapped copy of the input and those that take a non-const reference to a destination
That is precisely the purpose for swap<>() and swap_in_place<>()
- endian::iterator, which will iterate across a range swapping values as necessary. It works with any swappable type.
Nice idea!
I find it very useful when reading memory-mapped binary files containing aligned homogeneous data. Also, if the data is already in the order you need, the iterator factory simply returns the original iterator, meaning it's zero cost in that case. I look forward to any further questions/comments you may have. Tom