Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #70949

Re: Is there a way to determine endianess in a constexpr-function ?

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c++
Subject Re: Is there a way to determine endianess in a constexpr-function ?
Date 2020-01-02 00:47 +0000
Organization A noiseless patient Spider
Message-ID <87sgkyptu8.fsf@bsb.me.uk> (permalink)
References <quiidc$qa1$1@news.albasani.net> <h744cjF4glqU1@mid.individual.net> <quimd9$hek$2@news.albasani.net> <quj613$6nk$1@dont-email.me>

Show all headers | View raw


David Brown <david.brown@hesbynett.no> writes:

> On 01/01/2020 18:54, Bonita Montero wrote:
>>>> Is there a way to determine endianess in a constexpr-function
>>>> which might return true for little endian and false for big
>>>> endian? I guess not, but maybe I din't consider a trick here.
>>
>>> "Not" is probably the correct answer here, so in C++20 we get
>>> std::endian where the implementation provides the info.
>>> https://en.cppreference.com/w/cpp/types/endian
>>
>> Where's the support for the DEC PDP-11 and Honeywell 316 endianess???
>> ;-)
>>
>
> Gone - along with ones' complement integers.

Not entirely!  An implementation must signal a non-uniform endianness,
but it can't, using std::endian alone, say much more about it.

-- 
Ben.

Back to comp.lang.c++ | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Is there a way to determine endianess in a constexpr-function ? Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-01 17:46 +0100
  Re: Is there a way to determine endianess in a constexpr-function ? Bo Persson <bo@bo-persson.se> - 2020-01-01 18:49 +0100
    Re: Is there a way to determine endianess in a constexpr-function ? Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-01 18:54 +0100
      Re: Is there a way to determine endianess in a constexpr-function ? David Brown <david.brown@hesbynett.no> - 2020-01-01 23:21 +0100
        Re: Is there a way to determine endianess in a constexpr-function ? Robert Wessel <robertwessel2@yahoo.com> - 2020-01-01 18:26 -0600
        Re: Is there a way to determine endianess in a constexpr-function ? Ben Bacarisse <ben.usenet@bsb.me.uk> - 2020-01-02 00:47 +0000
  Re: Is there a way to determine endianess in a constexpr-function ? Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo> - 2020-01-02 22:28 -0500
    Re: Is there a way to determine endianess in a constexpr-function ? Siri Cruise <chine.bleu@yahoo.com> - 2020-01-02 19:51 -0800
    Re: Is there a way to determine endianess in a constexpr-function ? Öö Tiib <ootiib@hot.ee> - 2020-01-02 23:14 -0800
    Re: Is there a way to determine endianess in a constexpr-function ? Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-03 08:31 +0100
      Re: Is there a way to determine endianess in a constexpr-function ? Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-03 08:43 +0100
        Re: Is there a way to determine endianess in a constexpr-function ? Pavel <pauldontspamtolk@removeyourself.dontspam.yahoo> - 2020-01-05 00:51 -0500
          Re: Is there a way to determine endianess in a constexpr-function ? Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-05 07:43 +0100
            Re: Is there a way to determine endianess in a constexpr-function ? Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-05 08:31 +0100
              Re: Is there a way to determine endianess in a constexpr-function ? Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-05 08:34 +0100
              Re: Is there a way to determine endianess in a constexpr-function ? Bonita Montero <Bonita.Montero@gmail.com> - 2020-01-05 08:38 +0100

csiph-web