rope_traits.hpp 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // Boost string_algo library string_traits.hpp header file ---------------------------//
  2. // Copyright Pavol Droba 2002-2003.
  3. //
  4. // Distributed under the Boost Software License, Version 1.0.
  5. // (See accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. // See http://www.boost.org/ for updates, documentation, and revision history.
  8. #ifndef BOOST_STRING_STD_ROPE_TRAITS_HPP
  9. #define BOOST_STRING_STD_ROPE_TRAITS_HPP
  10. #include <boost/algorithm/string/yes_no_type.hpp>
  11. #include <rope>
  12. #include <boost/algorithm/string/sequence_traits.hpp>
  13. namespace boost {
  14. namespace algorithm {
  15. // SGI's std::rope<> traits -----------------------------------------------//
  16. #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  17. // native replace tester
  18. template<typename T, typename TraitsT, typename AllocT>
  19. yes_type has_native_replace_tester( const std::rope<T, TraitsT, AllocT>* );
  20. // stable iterators tester
  21. template<typename T, typename TraitsT, typename AllocT>
  22. yes_type has_stable_iterators_tester( const std::rope<T, TraitsT, AllocT>* );
  23. // const time insert tester
  24. template<typename T, typename TraitsT, typename AllocT>
  25. yes_type has_const_time_insert_tester( const std::rope<T, TraitsT, AllocT>* );
  26. // const time erase tester
  27. template<typename T, typename TraitsT, typename AllocT>
  28. yes_type has_const_time_erase_tester( const std::rope<T, TraitsT, AllocT>* );
  29. #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  30. // native replace trait
  31. template<typename T, typename TraitsT, typename AllocT>
  32. class has_native_replace< std::rope<T,TraitsT,AllocT> >
  33. {
  34. public:
  35. #if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  36. enum { value = true };
  37. #else
  38. BOOST_STATIC_CONSTANT(bool, value=true);
  39. #endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  40. typedef mpl::bool_<value> type;
  41. };
  42. // stable iterators trait
  43. template<typename T, typename TraitsT, typename AllocT>
  44. class has_stable_iterators< std::rope<T,TraitsT,AllocT> >
  45. {
  46. public:
  47. #if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  48. enum { value = true };
  49. #else
  50. BOOST_STATIC_CONSTANT(bool, value=true);
  51. #endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  52. typedef mpl::bool_<value> type;
  53. };
  54. // const time insert trait
  55. template<typename T, typename TraitsT, typename AllocT>
  56. class has_const_time_insert< std::rope<T,TraitsT,AllocT> >
  57. {
  58. public:
  59. #if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  60. enum { value = true };
  61. #else
  62. BOOST_STATIC_CONSTANT(bool, value=true);
  63. #endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  64. typedef mpl::bool_<value> type;
  65. };
  66. // const time erase trait
  67. template<typename T, typename TraitsT, typename AllocT>
  68. class has_const_time_erase< std::rope<T,TraitsT,AllocT> >
  69. {
  70. public:
  71. #if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  72. enum { value = true };
  73. #else
  74. BOOST_STATIC_CONSTANT(bool, value=true);
  75. #endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  76. typedef mpl::bool_<value> type;
  77. };
  78. #endif
  79. } // namespace algorithm
  80. } // namespace boost
  81. #endif // BOOST_STRING_ROPE_TRAITS_HPP