string.hpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // (C) Copyright Ion Gaztanaga 2015-2015. Distributed under the Boost
  4. // Software License, Version 1.0. (See accompanying file
  5. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  6. //
  7. // See http://www.boost.org/libs/container for documentation.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. #ifndef BOOST_CONTAINER_PMR_STRING_HPP
  11. #define BOOST_CONTAINER_PMR_STRING_HPP
  12. #if defined (_MSC_VER)
  13. # pragma once
  14. #endif
  15. #include <boost/container/string.hpp>
  16. #include <boost/container/pmr/polymorphic_allocator.hpp>
  17. namespace boost {
  18. namespace container {
  19. namespace pmr {
  20. #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
  21. template <class CharT, class Traits = std::char_traits<CharT> >
  22. using basic_string =
  23. boost::container::basic_string<CharT, Traits, polymorphic_allocator<CharT> >;
  24. #endif
  25. //! A portable metafunction to obtain a basic_string
  26. //! that uses a polymorphic allocator
  27. template <class CharT, class Traits = std::char_traits<CharT> >
  28. struct basic_string_of
  29. {
  30. typedef boost::container::basic_string
  31. <CharT, Traits, polymorphic_allocator<CharT> > type;
  32. };
  33. typedef basic_string_of<char>::type string;
  34. typedef basic_string_of<wchar_t>::type wstring;
  35. } //namespace pmr {
  36. } //namespace container {
  37. } //namespace boost {
  38. #endif //BOOST_CONTAINER_PMR_STRING_HPP