Subject: Re: [boost] [endian] Some suggestions
From: Peter Dimov (lists_at_[hidden])
Date: 2016-04-13 07:19:34
Beman Dawes wrote:
> But to follow the same pattern as the conversion functions, the interface
> would look like this:
> float endian_reverse(float x) noexcept;
> but like you and whoever raised the issue originally, I don't want to bet
> on that working.
Passing an arbitrary sequence of bytes by value should in principle be
avoided even for int because of trap representations, so adding float
support may provide the motivation to fix that as well.
The correct type of a wrong-endian-int or a wrong-endian-float is unsigned
char[sizeof(int)] or unsigned char[sizeof(float)], not int or float.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk