File indexing completed on 2024-11-16 09:07:42
0001 #ifndef BOOST_ENDIAN_DETAIL_INTEGRAL_BY_SIZE_HPP_INCLUDED
0002 #define BOOST_ENDIAN_DETAIL_INTEGRAL_BY_SIZE_HPP_INCLUDED
0003
0004
0005
0006
0007
0008
0009 #include <cstdint>
0010 #include <cstddef>
0011
0012 namespace boost
0013 {
0014 namespace endian
0015 {
0016 namespace detail
0017 {
0018
0019 template<std::size_t N> struct integral_by_size
0020 {
0021 };
0022
0023 template<> struct integral_by_size<1>
0024 {
0025 typedef std::uint8_t type;
0026 };
0027
0028 template<> struct integral_by_size<2>
0029 {
0030 typedef std::uint16_t type;
0031 };
0032
0033 template<> struct integral_by_size<4>
0034 {
0035 typedef std::uint32_t type;
0036 };
0037
0038 template<> struct integral_by_size<8>
0039 {
0040 typedef std::uint64_t type;
0041 };
0042
0043 #if defined(__SIZEOF_INT128__)
0044
0045 template<> struct integral_by_size<16>
0046 {
0047 typedef __uint128_t type;
0048 };
0049
0050 #endif
0051
0052 }
0053 }
0054 }
0055
0056 #endif