string 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. // -*- C++ -*-
  2. //===----------------------------------------------------------------------===//
  3. //
  4. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  5. // See https://llvm.org/LICENSE.txt for license information.
  6. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  7. //
  8. //===----------------------------------------------------------------------===//
  9. #ifndef _LIBCPP_EXPERIMENTAL_STRING
  10. #define _LIBCPP_EXPERIMENTAL_STRING
  11. /*
  12. experimental/string synopsis
  13. // C++1z
  14. namespace std {
  15. namespace experimental {
  16. inline namespace fundamentals_v1 {
  17. namespace pmr {
  18. // basic_string using polymorphic allocator in namespace pmr
  19. template <class charT, class traits = char_traits<charT>>
  20. using basic_string =
  21. std::basic_string<charT, traits, polymorphic_allocator<charT>>;
  22. // basic_string typedef names using polymorphic allocator in namespace
  23. // std::experimental::pmr
  24. typedef basic_string<char> string;
  25. typedef basic_string<char16_t> u16string;
  26. typedef basic_string<char32_t> u32string;
  27. typedef basic_string<wchar_t> wstring;
  28. } // namespace pmr
  29. } // namespace fundamentals_v1
  30. } // namespace experimental
  31. } // namespace std
  32. */
  33. #include <experimental/__config>
  34. #include <experimental/memory_resource>
  35. #include <string>
  36. #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
  37. # pragma GCC system_header
  38. #endif
  39. _LIBCPP_BEGIN_NAMESPACE_LFTS_PMR
  40. template <class _CharT, class _Traits = char_traits<_CharT>>
  41. using basic_string =
  42. _VSTD::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
  43. typedef basic_string<char> string;
  44. typedef basic_string<char16_t> u16string;
  45. typedef basic_string<char32_t> u32string;
  46. #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
  47. typedef basic_string<wchar_t> wstring;
  48. #endif
  49. _LIBCPP_END_NAMESPACE_LFTS_PMR
  50. #endif /* _LIBCPP_EXPERIMENTAL_STRING */