string_traits.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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_STRING_TRAITS_HPP
  9. #define BOOST_STRING_STD_STRING_TRAITS_HPP
  10. #include <boost/algorithm/string/yes_no_type.hpp>
  11. #include <string>
  12. #include <boost/algorithm/string/sequence_traits.hpp>
  13. namespace boost {
  14. namespace algorithm {
  15. // std::basic_string<> 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::basic_string<T, TraitsT, AllocT>* );
  20. #else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  21. // native replace trait
  22. template<typename T, typename TraitsT, typename AllocT>
  23. class has_native_replace< std::basic_string<T, TraitsT, AllocT> >
  24. {
  25. public:
  26. #if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  27. enum { value = true } ;
  28. #else
  29. BOOST_STATIC_CONSTANT(bool, value=true);
  30. #endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
  31. typedef mpl::bool_<has_native_replace<T>::value> type;
  32. };
  33. #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
  34. } // namespace algorithm
  35. } // namespace boost
  36. #endif // BOOST_STRING_LIST_TRAITS_HPP