liuxiaolong
2021-07-20 58d904a328c0d849769b483e901a0be9426b8209
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef BOOST_ENDIAN_DETAIL_INTEGRAL_BY_SIZE_HPP_INCLUDED
#define BOOST_ENDIAN_DETAIL_INTEGRAL_BY_SIZE_HPP_INCLUDED
 
// Copyright 2019 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// http://www.boost.org/LICENSE_1_0.txt
 
#include <boost/cstdint.hpp>
#include <boost/config.hpp>
#include <cstddef>
 
namespace boost
{
namespace endian
{
namespace detail
{
 
template<std::size_t N> struct integral_by_size
{
};
 
template<> struct integral_by_size<1>
{
    typedef uint8_t type;
};
 
template<> struct integral_by_size<2>
{
    typedef uint16_t type;
};
 
template<> struct integral_by_size<4>
{
    typedef uint32_t type;
};
 
template<> struct integral_by_size<8>
{
    typedef uint64_t type;
};
 
#if defined(BOOST_HAS_INT128)
 
template<> struct integral_by_size<16>
{
    typedef uint128_type type;
};
 
#endif
 
} // namespace detail
} // namespace endian
} // namespace boost
 
#endif  // BOOST_ENDIAN_DETAIL_INTEGRAL_BY_SIZE_HPP_INCLUDED