Blame view

3rdparty/boost_1_81_0/boost/interprocess/detail/mpl.hpp 2.21 KB
63e88f80   Hu Chunming   提交三方库
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
  //////////////////////////////////////////////////////////////////////////////
  //
  // (C) Copyright Ion Gaztanaga 2005-2016.
  //
  // Distributed under the Boost Software License, Version 1.0.
  // (See accompanying file LICENSE_1_0.txt or copy at
  // http://www.boost.org/LICENSE_1_0.txt)
  //
  // See http://www.boost.org/libs/interprocess for documentation.
  //
  //////////////////////////////////////////////////////////////////////////////
  
  #ifndef BOOST_INTERPROCESS_DETAIL_MPL_HPP
  #define BOOST_INTERPROCESS_DETAIL_MPL_HPP
  
  #ifndef BOOST_CONFIG_HPP
  #  include <boost/config.hpp>
  #endif
  #
  #if defined(BOOST_HAS_PRAGMA_ONCE)
  #  pragma once
  #endif
  
  #include <cstddef>
  
  namespace boost {
  namespace interprocess {
  namespace ipcdetail {
  
  template <class T, T val>
  struct integral_constant
  {
     static const T value = val;
     typedef integral_constant<T,val> type;
  };
  
  template< bool C_ >
  struct bool_ : integral_constant<bool, C_>
  {
     static const bool value = C_;
  };
  
  typedef bool_<true>        true_;
  typedef bool_<false>       false_;
  
  typedef true_  true_type;
  typedef false_ false_type;
  
  typedef char yes_type;
  struct no_type
  {
     char padding[8];
  };
  
  template <bool B, class T = void>
  struct enable_if_c {
    typedef T type;
  };
  
  template <class T>
  struct enable_if_c<false, T> {};
  
  template <class Cond, class T = void>
  struct enable_if : public enable_if_c<Cond::value, T> {};
  
  template <class Cond, class T = void>
  struct disable_if : public enable_if_c<!Cond::value, T> {};
  
  template<
        bool C
      , typename T1
      , typename T2
      >
  struct if_c
  {
      typedef T1 type;
  };
  
  template<
        typename T1
      , typename T2
      >
  struct if_c<false,T1,T2>
  {
      typedef T2 type;
  };
  
  template<
        typename T1
      , typename T2
      , typename T3
      >
  struct if_
  {
     typedef typename if_c<0 != T1::value, T2, T3>::type type;
  };
  
  
  template<std::size_t S>
  struct ls_zeros
  {
     static const std::size_t value = (S & std::size_t(1)) ? 0 : (1u + ls_zeros<(S >> 1u)>::value);
  };
  
  template<>
  struct ls_zeros<0>
  {
     static const std::size_t value = 0;
  };
  
  template<>
  struct ls_zeros<1>
  {
     static const std::size_t value = 0;
  };
  
  }  //namespace ipcdetail {
  }  //namespace interprocess {
  }  //namespace boost {
  
  #endif   //#ifndef BOOST_INTERPROCESS_DETAIL_MPL_HPP