slist_traits.hpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. // Boost string_algo library slist_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_SLIST_TRAITS_HPP
  9. #define BOOST_STRING_STD_SLIST_TRAITS_HPP
  10. #include <boost/algorithm/string/config.hpp>
  11. #include <boost/algorithm/string/yes_no_type.hpp>
  12. #include BOOST_SLIST_HEADER
  13. #include <boost/algorithm/string/sequence_traits.hpp>
  14. namespace boost {
  15. namespace algorithm {
  16. // SGI's std::slist<> traits -----------------------------------------------//
  17. // stable iterators trait
  18. template<typename T, typename AllocT>
  19. class has_stable_iterators< BOOST_STD_EXTENSION_NAMESPACE::slist<T,AllocT> >
  20. {
  21. public:
  22. #if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  23. enum { value = true };
  24. #else
  25. BOOST_STATIC_CONSTANT(bool, value=true);
  26. #endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  27. typedef mpl::bool_<has_stable_iterators<T>::value> type;
  28. };
  29. // const time insert trait
  30. template<typename T, typename AllocT>
  31. class has_const_time_insert< BOOST_STD_EXTENSION_NAMESPACE::slist<T,AllocT> >
  32. {
  33. public:
  34. #if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  35. enum { value = true };
  36. #else
  37. BOOST_STATIC_CONSTANT(bool, value=true);
  38. #endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  39. typedef mpl::bool_<has_const_time_insert<T>::value> type;
  40. };
  41. // const time erase trait
  42. template<typename T, typename AllocT>
  43. class has_const_time_erase< BOOST_STD_EXTENSION_NAMESPACE::slist<T,AllocT> >
  44. {
  45. public:
  46. #if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  47. enum { value = true };
  48. #else
  49. BOOST_STATIC_CONSTANT(bool, value=true);
  50. #endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  51. typedef mpl::bool_<has_const_time_erase<T>::value> type;
  52. };
  53. } // namespace algorithm
  54. } // namespace boost
  55. #endif // BOOST_STRING_STD_LIST_TRAITS_HPP