6 * Use, modification and distribution are subject to the
7 * Boost Software License, Version 1.0. (See accompanying file
8 * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
13 * LOCATION: see http://www.boost.org for most recent version.
14 * FILE regex_match.hpp
15 * VERSION see <boost/version.hpp>
16 * DESCRIPTION: Iterator traits for selecting an iterator type as
17 * an integral constant expression.
21 #ifndef BOOST_REGEX_ITERATOR_CATEGORY_HPP
22 #define BOOST_REGEX_ITERATOR_CATEGORY_HPP
25 #include <boost/type_traits/is_convertible.hpp>
26 #include <boost/type_traits/is_pointer.hpp>
34 #ifndef BOOST_NO_STD_ITERATOR_TRAITS
36 typedef typename
std::iterator_traits
<I
>::iterator_category cat
;
38 BOOST_STATIC_CONSTANT(bool, value
= (::boost::is_convertible
<cat
*, std::random_access_iterator_tag
*>::value
));
40 BOOST_STATIC_CONSTANT(bool, value
= false);
45 struct is_random_pointer_imp
47 BOOST_STATIC_CONSTANT(bool, value
= true);
50 template <bool is_pointer_type
>
51 struct is_random_imp_selector
56 typedef is_random_imp
<I
> type
;
61 struct is_random_imp_selector
<true>
66 typedef is_random_pointer_imp
<I
> type
;
73 struct is_random_access_iterator
76 typedef detail::is_random_imp_selector
< ::boost::is_pointer
<I
>::value
> selector
;
77 typedef typename
selector::template rebind
<I
> bound_type
;
78 typedef typename
bound_type::type answer
;
80 BOOST_STATIC_CONSTANT(bool, value
= answer::value
);
83 #ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
85 const bool is_random_access_iterator
<I
>::value
;