8 May
2013
8 May
'13
6:15 a.m.
On Wed, May 8, 2013 at 9:51 AM, Adrian_H <adrianh.bsc@gmail.com> wrote:
I've been looking around and am just shocked that there doesn't seem to be any way of using the optimizer or templating system in any consistent way across compilers to generate a compile time endinness value. Does anyone know why the C++ committee has steered clear of this?
I don't think there is a way of deducing endianness through templates since templates deal with integer values and not their binary representation. Through constexpr maybe?.. I can't speak for the committee, but my understanding is that C++ Standard tries to avoid dealing with binary representation of data to not limit implementations. Things started to change though with adding <cstdint> types.