File indexing completed on 2026-04-03 08:10:28
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #ifndef BOOST_MOVE_DETAIL_ITERATOR_TRAITS_HPP
0015 #define BOOST_MOVE_DETAIL_ITERATOR_TRAITS_HPP
0016
0017 #ifndef BOOST_CONFIG_HPP
0018 # include <boost/config.hpp>
0019 #endif
0020 0021 ">#
0022 #if defined(BOOST_HAS_PRAGMA_ONCE)
0023 # pragma once
0024 #endif
0025
0026 #if (BOOST_CXX_VERSION > 201703L) && defined(__cpp_lib_concepts)
0027
0028 #include <iterator>
0029
0030 #define BOOST_MOVE_CONTIGUOUS_ITERATOR_TAG
0031
0032 namespace boost {
0033 namespace movelib {
0034
0035 using std::iterator_traits;
0036
0037 template<class T>
0038 struct iter_difference
0039 {
0040 typedef typename std::iterator_traits<T>::difference_type type;
0041 };
0042
0043 template<class T>
0044 struct iter_value
0045 {
0046 typedef typename std::iterator_traits<T>::value_type type;
0047 };
0048
0049 template<class T>
0050 struct iter_category
0051 {
0052 typedef typename std::iterator_traits<T>::iterator_category type;
0053 };
0054
0055 }}
0056
0057 #else
0058
0059 #include <cstddef>
0060 #include <boost/move/detail/type_traits.hpp>
0061
0062 #include <boost/move/detail/std_ns_begin.hpp>
0063
0064 BOOST_MOVE_STD_NS_BEG
0065
0066 struct input_iterator_tag;
0067 struct forward_iterator_tag;
0068 struct bidirectional_iterator_tag;
0069 struct random_access_iterator_tag;
0070 struct output_iterator_tag;
0071
0072 #if ( (defined(BOOST_GNU_STDLIB) && (__cplusplus > 201703L))\
0073 || (defined(_LIBCPP_VERSION) && (_LIBCPP_STD_VER > 17))\
0074 || (defined(_YVALS) && defined(_CPPLIB_VER) && defined(__cpp_lib_concepts))\
0075 || (__cplusplus >= 202002L)\
0076 )
0077 # define BOOST_MOVE_CONTIGUOUS_ITERATOR_TAG
0078 struct contiguous_iterator_tag;
0079
0080 #endif
0081
0082 BOOST_MOVE_STD_NS_END
0083
0084 #include <boost/move/detail/std_ns_end.hpp>
0085
0086 namespace boost{ namespace movelib{
0087
0088 template<class T>
0089 struct iter_difference
0090 {
0091 typedef typename T::difference_type type;
0092 };
0093
0094 template<class T>
0095 struct iter_difference<T*>
0096 {
0097 typedef std::ptrdiff_t type;
0098 };
0099
0100 template<class T>
0101 struct iter_value
0102 {
0103 typedef typename T::value_type type;
0104 };
0105
0106 template<class T>
0107 struct iter_value<T*>
0108 {
0109 typedef T type;
0110 };
0111
0112 template<class T>
0113 struct iter_value<const T*>
0114 {
0115 typedef T type;
0116 };
0117
0118 template<class T>
0119 struct iter_category
0120 {
0121 typedef typename T::iterator_category type;
0122 };
0123
0124
0125 template<class T>
0126 struct iter_category<T*>
0127 {
0128 typedef std::random_access_iterator_tag type;
0129 };
0130
0131 template<class Iterator>
0132 struct iterator_traits
0133 {
0134 typedef typename iter_difference<Iterator>::type difference_type;
0135 typedef typename iter_value<Iterator>::type value_type;
0136 typedef typename Iterator::pointer pointer;
0137 typedef typename Iterator::reference reference;
0138 typedef typename iter_category<Iterator>::type iterator_category;
0139 };
0140
0141 template<class T>
0142 struct iterator_traits<T*>
0143 {
0144 typedef std::ptrdiff_t difference_type;
0145 typedef T value_type;
0146 typedef T* pointer;
0147 typedef T& reference;
0148 typedef std::random_access_iterator_tag iterator_category;
0149 };
0150
0151 template<class T>
0152 struct iterator_traits<const T*>
0153 {
0154 typedef std::ptrdiff_t difference_type;
0155 typedef T value_type;
0156 typedef const T* pointer;
0157 typedef const T& reference;
0158 typedef std::random_access_iterator_tag iterator_category;
0159 };
0160
0161 }}
0162
0163 #endif
0164
0165 #include <boost/move/detail/type_traits.hpp>
0166
0167 namespace boost {
0168 namespace movelib {
0169
0170 template<class T>
0171 struct iter_size
0172 : boost::move_detail::
0173 make_unsigned<typename iter_difference<T>::type >
0174 {};
0175
0176 }}
0177
0178 #endif