Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:51:23

0001 /*
0002  *
0003  * Copyright (c) 1998-2002
0004  * John Maddock
0005  *
0006  * Use, modification and distribution are subject to the 
0007  * Boost Software License, Version 1.0. (See accompanying file 
0008  * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
0009  *
0010  */
0011 
0012  /*
0013   *   LOCATION:    see http://www.boost.org for most recent version.
0014   *   FILE         iterator_traits.cpp
0015   *   VERSION      see <boost/version.hpp>
0016   *   DESCRIPTION: Declares iterator traits workarounds.
0017   */
0018 
0019 #ifndef BOOST_REGEX_V4_ITERATOR_TRAITS_HPP
0020 #define BOOST_REGEX_V4_ITERATOR_TRAITS_HPP
0021 
0022 #ifdef BOOST_MSVC
0023 #pragma warning(push)
0024 #pragma warning(disable: 4103)
0025 #endif
0026 #ifdef BOOST_HAS_ABI_HEADERS
0027 #  include BOOST_ABI_PREFIX
0028 #endif
0029 #ifdef BOOST_MSVC
0030 #pragma warning(pop)
0031 #endif
0032 
0033 namespace boost{
0034 namespace BOOST_REGEX_DETAIL_NS{
0035 
0036 #if defined(BOOST_NO_STD_ITERATOR_TRAITS)
0037 
0038 template <class T>
0039 struct regex_iterator_traits 
0040 {
0041   typedef typename T::iterator_category iterator_category;
0042   typedef typename T::value_type        value_type;
0043 #if !defined(BOOST_NO_STD_ITERATOR)
0044   typedef typename T::difference_type   difference_type;
0045   typedef typename T::pointer           pointer;
0046   typedef typename T::reference         reference;
0047 #else
0048   typedef std::ptrdiff_t                difference_type;
0049   typedef value_type*                   pointer;
0050   typedef value_type&                   reference;
0051 #endif
0052 };
0053 
0054 template <class T>
0055 struct pointer_iterator_traits
0056 {
0057    typedef std::ptrdiff_t difference_type;
0058    typedef T value_type;
0059    typedef T* pointer;
0060    typedef T& reference;
0061    typedef std::random_access_iterator_tag iterator_category;
0062 };
0063 template <class T>
0064 struct const_pointer_iterator_traits
0065 {
0066    typedef std::ptrdiff_t difference_type;
0067    typedef T value_type;
0068    typedef const T* pointer;
0069    typedef const T& reference;
0070    typedef std::random_access_iterator_tag iterator_category;
0071 };
0072 
0073 template<>
0074 struct regex_iterator_traits<char*> : pointer_iterator_traits<char>{};
0075 template<>
0076 struct regex_iterator_traits<const char*> : const_pointer_iterator_traits<char>{};
0077 template<>
0078 struct regex_iterator_traits<wchar_t*> : pointer_iterator_traits<wchar_t>{};
0079 template<>
0080 struct regex_iterator_traits<const wchar_t*> : const_pointer_iterator_traits<wchar_t>{};
0081 //
0082 // the follwoing are needed for ICU support:
0083 //
0084 template<>
0085 struct regex_iterator_traits<unsigned char*> : pointer_iterator_traits<char>{};
0086 template<>
0087 struct regex_iterator_traits<const unsigned char*> : const_pointer_iterator_traits<char>{};
0088 template<>
0089 struct regex_iterator_traits<int*> : pointer_iterator_traits<int>{};
0090 template<>
0091 struct regex_iterator_traits<const int*> : const_pointer_iterator_traits<int>{};
0092 
0093 #ifdef BOOST_REGEX_HAS_OTHER_WCHAR_T
0094 template<>
0095 struct regex_iterator_traits<unsigned short*> : pointer_iterator_traits<unsigned short>{};
0096 template<>
0097 struct regex_iterator_traits<const unsigned short*> : const_pointer_iterator_traits<unsigned short>{};
0098 #endif
0099 
0100 #if defined(__SGI_STL_PORT) && defined(__STL_DEBUG)
0101 template<>
0102 struct regex_iterator_traits<std::string::iterator> : pointer_iterator_traits<char>{};
0103 template<>
0104 struct regex_iterator_traits<std::string::const_iterator> : const_pointer_iterator_traits<char>{};
0105 #ifndef BOOST_NO_STD_WSTRING
0106 template<>
0107 struct regex_iterator_traits<std::wstring::iterator> : pointer_iterator_traits<wchar_t>{};
0108 template<>
0109 struct regex_iterator_traits<std::wstring::const_iterator> : const_pointer_iterator_traits<wchar_t>{};
0110 #endif // BOOST_NO_WSTRING
0111 #endif // stport
0112 
0113 #else
0114 
0115 template <class T>
0116 struct regex_iterator_traits : public std::iterator_traits<T> {};
0117 
0118 #endif
0119 
0120 } // namespace BOOST_REGEX_DETAIL_NS
0121 } // namespace boost
0122 
0123 #ifdef BOOST_MSVC
0124 #pragma warning(push)
0125 #pragma warning(disable: 4103)
0126 #endif
0127 #ifdef BOOST_HAS_ABI_HEADERS
0128 #  include BOOST_ABI_SUFFIX
0129 #endif
0130 #ifdef BOOST_MSVC
0131 #pragma warning(pop)
0132 #endif
0133 
0134 #endif
0135