Q: Is Boost endian library platform-independent? There is a valid uint8_t* buffer with four uint8_t bytes.
I know the buffer contains two uint16_t numbers in big-endian format, and I want to extract them.
I can create the required data manually, while taking care of the correct endianness:
const std::uint8_t* data = ...
uint16_t first =  (data[1]<<8) + data[0];
uint16_t second = (data[3]<<8) + data[2];

I have been told (thanks to @eerorika):

this works the same way on all systems. This reads the data as little
  endian, whether the CPU is little, big or some other endian. This is
  well portable.

And this works as intended.
Now let's consider another solution with Boost's endian library:
struct datatype {
    boost::endian::little_int16_buf_t     first;
    boost::endian::little_int16_buf_t     second;
} d;

memcpy(&d, data, sizeof d);

This solution also works, and my question is: is this in any way worse in terms of portability, platform- and CPU-dependency than the first? 
If I compile and run this on a non little-endian architecture, will it produce the same values as on a little-endian one?
