mn_endianness.hpp
Go to the documentation of this file.
1 
20 #ifndef _MINLIB_BASIC_ENDIAN_H_
21 #define _MINLIB_BASIC_ENDIAN_H_
22 
23 #include "mn_config.hpp"
24 #include "mn_functional.hpp"
25 
26 namespace mn {
27  namespace endian {
28  enum class order {
29  little,
30  big,
31  native
32  };
33  enum class align {
34  no,
35  yes
36  };
37  }
42  struct system_endian {
47  endian::order operator() const noexcept {
48  short tester = 0x0001;
49  return (*(char*)&tester != 0) ? endian::order::little : endian::order::big;
50  }
51  }
52 }
53 
54 
55 
56 #endif // _MINLIB_BASIC_ENDIAN_H_
order
Definition: mn_endianness.hpp:28
align
Definition: mn_endianness.hpp:33
Definition: mn_allocator_typetraits.hpp:25
Get the underlying endian architecture?
Definition: mn_endianness.hpp:42
endian::order operator() const noexcept
Get the underlying endian architecture?
Definition: mn_endianness.hpp:47