File indexing completed on 2025-01-18 09:51:23
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 <boost/type_traits/is_convertible.hpp>
0026 #include <boost/type_traits/is_pointer.hpp>
0027
0028 namespace boost{
0029 namespace detail{
0030
0031 template <class I>
0032 struct is_random_imp
0033 {
0034 #ifndef BOOST_NO_STD_ITERATOR_TRAITS
0035 private:
0036 typedef typename std::iterator_traits<I>::iterator_category cat;
0037 public:
0038 BOOST_STATIC_CONSTANT(bool, value = (::boost::is_convertible<cat*, std::random_access_iterator_tag*>::value));
0039 #else
0040 BOOST_STATIC_CONSTANT(bool, value = false);
0041 #endif
0042 };
0043
0044 template <class I>
0045 struct is_random_pointer_imp
0046 {
0047 BOOST_STATIC_CONSTANT(bool, value = true);
0048 };
0049
0050 template <bool is_pointer_type>
0051 struct is_random_imp_selector
0052 {
0053 template <class I>
0054 struct rebind
0055 {
0056 typedef is_random_imp<I> type;
0057 };
0058 };
0059
0060 template <>
0061 struct is_random_imp_selector<true>
0062 {
0063 template <class I>
0064 struct rebind
0065 {
0066 typedef is_random_pointer_imp<I> type;
0067 };
0068 };
0069
0070 }
0071
0072 template <class I>
0073 struct is_random_access_iterator
0074 {
0075 private:
0076 typedef detail::is_random_imp_selector< ::boost::is_pointer<I>::value> selector;
0077 typedef typename selector::template rebind<I> bound_type;
0078 typedef typename bound_type::type answer;
0079 public:
0080 BOOST_STATIC_CONSTANT(bool, value = answer::value);
0081 };
0082
0083 #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
0084 template <class I>
0085 const bool is_random_access_iterator<I>::value;
0086 #endif
0087
0088 }
0089
0090 #endif
0091