list_traits.hpp 2.1 KB

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