
3 Jun
2010
3 Jun
'10
4:35 p.m.
John Bytheway wrote:
endian::cast<big_to_host>() //explicit direction endian::cast<from_litle>() //"to_host" is implicit endian::cast<to_big>() //"from_host" is implicit
I actually really like that. What do you think?
Yes! I do like that. For the out-of-place version, I think this is definitely better than the swap-based names.
I don't think the function should use "cast" because the return type and parameter type are the same. I don't think the function name should use "swap" either because that is an implementation detail. Perhaps endian_transform or endian_convert instead? terry