Blame view

3rdparty/boost_1_81_0/boost/stl_interfaces/fwd.hpp 2.99 KB
0b6a182c   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
  // Copyright (C) 2019 T. Zachary Laine
  //
  // 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)
  #ifndef BOOST_STL_INTERFACES_FWD_HPP
  #define BOOST_STL_INTERFACES_FWD_HPP
  
  #include <boost/stl_interfaces/config.hpp>
  
  #if BOOST_STL_INTERFACES_USE_CONCEPTS
  #include <ranges>
  #endif
  #if defined(__cpp_lib_three_way_comparison)
  #include <compare>
  #endif
  
  #ifndef BOOST_STL_INTERFACES_DOXYGEN
  
  #if defined(_MSC_VER) || defined(__GNUC__) && __GNUC__ < 8
  #define BOOST_STL_INTERFACES_NO_HIDDEN_FRIEND_CONSTEXPR
  #define BOOST_STL_INTERFACES_HIDDEN_FRIEND_CONSTEXPR
  #else
  #define BOOST_STL_INTERFACES_HIDDEN_FRIEND_CONSTEXPR constexpr
  #endif
  
  #if defined(__GNUC__) && __GNUC__ < 9
  #define BOOST_STL_INTERFACES_CONCEPT concept bool
  #else
  #define BOOST_STL_INTERFACES_CONCEPT concept
  #endif
  
  #endif
  
  
  namespace boost { namespace stl_interfaces {
  
      /** An enumeration used to indicate whether the underlying data have a
          contiguous or discontiguous layout when instantiating `view_interface`
          and `sequence_container_interface`. */
      enum class element_layout : bool {
          discontiguous = false,
          contiguous = true
      };
  
      BOOST_STL_INTERFACES_NAMESPACE_V1 {
  
          namespace v1_dtl {
              template<typename... T>
              using void_t = void;
  
              template<typename Iter>
              using iter_difference_t =
                  typename std::iterator_traits<Iter>::difference_type;
  
              template<typename Range, typename = void>
              struct iterator;
              template<typename Range>
              struct iterator<
                  Range,
                  void_t<decltype(std::declval<Range &>().begin())>>
              {
                  using type = decltype(std::declval<Range &>().begin());
              };
              template<typename Range>
              using iterator_t = typename iterator<Range>::type;
  
              template<typename Range, typename = void>
              struct sentinel;
              template<typename Range>
              struct sentinel<
                  Range,
                  void_t<decltype(std::declval<Range &>().end())>>
              {
                  using type = decltype(std::declval<Range &>().end());
              };
              template<typename Range>
              using sentinel_t = typename sentinel<Range>::type;
  
              template<typename Range>
              using range_difference_t = iter_difference_t<iterator_t<Range>>;
  
              template<typename Range>
              using common_range =
                  std::is_same<iterator_t<Range>, sentinel_t<Range>>;
  
              template<typename Range, typename = void>
              struct decrementable_sentinel : std::false_type
              {
              };
              template<typename Range>
              struct decrementable_sentinel<
                  Range,
                  void_t<decltype(--std::declval<sentinel_t<Range> &>())>>
                  : std::true_type
              {
              };
          }
  
      }
  }}
  
  #endif