stringfwd.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. // <string> Forward declarations -*- C++ -*-
  2. // Copyright (C) 2001-2022 Free Software Foundation, Inc.
  3. //
  4. // This file is part of the GNU ISO C++ Library. This library is free
  5. // software; you can redistribute it and/or modify it under the
  6. // terms of the GNU General Public License as published by the
  7. // Free Software Foundation; either version 3, or (at your option)
  8. // any later version.
  9. // This library is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU General Public License for more details.
  13. // Under Section 7 of GPL version 3, you are granted additional
  14. // permissions described in the GCC Runtime Library Exception, version
  15. // 3.1, as published by the Free Software Foundation.
  16. // You should have received a copy of the GNU General Public License and
  17. // a copy of the GCC Runtime Library Exception along with this program;
  18. // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  19. // <http://www.gnu.org/licenses/>.
  20. /** @file bits/stringfwd.h
  21. * This is an internal header file, included by other library headers.
  22. * Do not attempt to use it directly. @headername{string}
  23. */
  24. //
  25. // ISO C++ 14882: 21 Strings library
  26. //
  27. #ifndef _STRINGFWD_H
  28. #define _STRINGFWD_H 1
  29. #pragma GCC system_header
  30. #include <bits/c++config.h>
  31. #include <bits/memoryfwd.h>
  32. namespace std _GLIBCXX_VISIBILITY(default)
  33. {
  34. _GLIBCXX_BEGIN_NAMESPACE_VERSION
  35. /**
  36. * @defgroup strings Strings
  37. *
  38. * @{
  39. */
  40. template<class _CharT>
  41. struct char_traits;
  42. template<> struct char_traits<char>;
  43. template<> struct char_traits<wchar_t>;
  44. #ifdef _GLIBCXX_USE_CHAR8_T
  45. template<> struct char_traits<char8_t>;
  46. #endif
  47. #if __cplusplus >= 201103L
  48. template<> struct char_traits<char16_t>;
  49. template<> struct char_traits<char32_t>;
  50. #endif
  51. _GLIBCXX_BEGIN_NAMESPACE_CXX11
  52. template<typename _CharT, typename _Traits = char_traits<_CharT>,
  53. typename _Alloc = allocator<_CharT> >
  54. class basic_string;
  55. _GLIBCXX_END_NAMESPACE_CXX11
  56. /// A string of @c char
  57. typedef basic_string<char> string;
  58. /// A string of @c wchar_t
  59. typedef basic_string<wchar_t> wstring;
  60. #ifdef _GLIBCXX_USE_CHAR8_T
  61. /// A string of @c char8_t
  62. typedef basic_string<char8_t> u8string;
  63. #endif
  64. #if __cplusplus >= 201103L
  65. /// A string of @c char16_t
  66. typedef basic_string<char16_t> u16string;
  67. /// A string of @c char32_t
  68. typedef basic_string<char32_t> u32string;
  69. #endif
  70. /** @} */
  71. _GLIBCXX_END_NAMESPACE_VERSION
  72. } // namespace std
  73. #endif // _STRINGFWD_H