File indexing completed on 2025-12-16 10:08:36
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef BOOST_REGEX_ITERATOR_CATEGORY_HPP
0022 #define BOOST_REGEX_ITERATOR_CATEGORY_HPP
0023
0024 #include <iterator>
0025 #include <type_traits>
0026
0027 namespace boost{
0028 namespace detail{
0029
0030 template <class I>
0031 struct is_random_imp
0032 {
0033 private:
0034 typedef typename std::iterator_traits<I>::iterator_category cat;
0035 public:
0036 static const bool value = (std::is_convertible<cat*, std::random_access_iterator_tag*>::value);
0037 };
0038
0039 template <class I>
0040 struct is_random_pointer_imp
0041 {
0042 static const bool value = true;
0043 };
0044
0045 template <bool is_pointer_type>
0046 struct is_random_imp_selector
0047 {
0048 template <class I>
0049 struct rebind
0050 {
0051 typedef is_random_imp<I> type;
0052 };
0053 };
0054
0055 template <>
0056 struct is_random_imp_selector<true>
0057 {
0058 template <class I>
0059 struct rebind
0060 {
0061 typedef is_random_pointer_imp<I> type;
0062 };
0063 };
0064
0065 }
0066
0067 template <class I>
0068 struct is_random_access_iterator
0069 {
0070 private:
0071 typedef detail::is_random_imp_selector< std::is_pointer<I>::value> selector;
0072 typedef typename selector::template rebind<I> bound_type;
0073 typedef typename bound_type::type answer;
0074 public:
0075 static const bool value = answer::value;
0076 };
0077
0078 template <class I>
0079 const bool is_random_access_iterator<I>::value;
0080
0081 }
0082
0083 #endif
0084