text: Q:
  
  Is this conversion of an INT32BE macro to a constexpr correct?
  
  I have the following macro and wanted to convert it to a constexpr as apparently it's a better approach:
  #define INT32BE(x) (x[0] << 24 | x[1] << 16 | x[2] << 8 | x[3])
  
  Attempt:
  template <typename T>
  constexpr auto Int32BE(T array [])
  {
      return array[0] << 24 | array[1] << 16 | array[2] << 8 | array[3];
  }
  
  This is intended to be used in the following way:
  const auto address = Int32BE(data.Address);
  
  The definition of Address is as follows:
  UCHAR Address[4];
  
  It does work as expected but I'm not totally sure about how it should be written.
  Question:
  Is this constexpr to read a 32-bit integer from an array written correctly ?
  
  A:
  
  I cannot speak from a 'language-lawyer' perspective, but the constexpr you have given compiles without warning in the following code, with both MSVC and clang-cl:
  #include <stdio.h>
  
  template <typename T>
  constexpr auto Int32BE(T array[]) {
      return array[0] << 24 | array[1] << 16 | array[2] << 8 | array[3];
  }
  
  int main() {
      unsigned char Address[4] = { 0x22, 0xAA, 0x11, 0xBB };
      const auto address = Int32BE(Address);
      printf("%08X\n", address);
      return 0;
  }
  
  Further, the output is the expected value (22AA11BB).
  
  