$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [boost] The file boost/detail/endian.hpp needs to be set up for your CPU type
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2013-05-08 02:15:11
On Wed, May 8, 2013 at 9:51 AM, Adrian_H <adrianh.bsc_at_[hidden]> 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.