Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-05-03 08:13:31

0001 //===----------------------------------------------------------------------===//
0002 //
0003 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
0004 // See https://llvm.org/LICENSE.txt for license information.
0005 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
0006 //
0007 //===----------------------------------------------------------------------===//
0008 
0009 #ifndef _LIBCPP___CXX03___FWD_STRING_H
0010 #define _LIBCPP___CXX03___FWD_STRING_H
0011 
0012 #include <__cxx03/__config>
0013 #include <__cxx03/__fwd/memory.h>
0014 #include <__cxx03/__fwd/memory_resource.h>
0015 
0016 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
0017 #  pragma GCC system_header
0018 #endif
0019 
0020 _LIBCPP_BEGIN_NAMESPACE_STD
0021 
0022 template <class _CharT>
0023 struct _LIBCPP_TEMPLATE_VIS char_traits;
0024 template <>
0025 struct char_traits<char>;
0026 
0027 #ifndef _LIBCPP_HAS_NO_CHAR8_T
0028 template <>
0029 struct char_traits<char8_t>;
0030 #endif
0031 
0032 template <>
0033 struct char_traits<char16_t>;
0034 template <>
0035 struct char_traits<char32_t>;
0036 
0037 #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
0038 template <>
0039 struct char_traits<wchar_t>;
0040 #endif
0041 
0042 template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >
0043 class _LIBCPP_TEMPLATE_VIS basic_string;
0044 
0045 using string = basic_string<char>;
0046 
0047 #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
0048 using wstring = basic_string<wchar_t>;
0049 #endif
0050 
0051 #ifndef _LIBCPP_HAS_NO_CHAR8_T
0052 using u8string = basic_string<char8_t>;
0053 #endif
0054 
0055 using u16string = basic_string<char16_t>;
0056 using u32string = basic_string<char32_t>;
0057 
0058 #if _LIBCPP_STD_VER >= 17
0059 
0060 namespace pmr {
0061 template <class _CharT, class _Traits = char_traits<_CharT>>
0062 using basic_string _LIBCPP_AVAILABILITY_PMR = std::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;
0063 
0064 using string _LIBCPP_AVAILABILITY_PMR = basic_string<char>;
0065 
0066 #  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
0067 using wstring _LIBCPP_AVAILABILITY_PMR = basic_string<wchar_t>;
0068 #  endif
0069 
0070 #  ifndef _LIBCPP_HAS_NO_CHAR8_T
0071 using u8string _LIBCPP_AVAILABILITY_PMR = basic_string<char8_t>;
0072 #  endif
0073 
0074 using u16string _LIBCPP_AVAILABILITY_PMR = basic_string<char16_t>;
0075 using u32string _LIBCPP_AVAILABILITY_PMR = basic_string<char32_t>;
0076 } // namespace pmr
0077 
0078 #endif // _LIBCPP_STD_VER >= 17
0079 
0080 // clang-format off
0081 template <class _CharT, class _Traits, class _Allocator>
0082 class _LIBCPP_PREFERRED_NAME(string)
0083 #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
0084       _LIBCPP_PREFERRED_NAME(wstring)
0085 #endif
0086 #ifndef _LIBCPP_HAS_NO_CHAR8_T
0087       _LIBCPP_PREFERRED_NAME(u8string)
0088 #endif
0089       _LIBCPP_PREFERRED_NAME(u16string)
0090       _LIBCPP_PREFERRED_NAME(u32string)
0091 #if _LIBCPP_STD_VER >= 17
0092       _LIBCPP_PREFERRED_NAME(pmr::string)
0093 #  ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
0094       _LIBCPP_PREFERRED_NAME(pmr::wstring)
0095 #  endif
0096 #  ifndef _LIBCPP_HAS_NO_CHAR8_T
0097       _LIBCPP_PREFERRED_NAME(pmr::u8string)
0098 #  endif
0099       _LIBCPP_PREFERRED_NAME(pmr::u16string)
0100       _LIBCPP_PREFERRED_NAME(pmr::u32string)
0101 #endif
0102       basic_string;
0103 // clang-format on
0104 
0105 _LIBCPP_END_NAMESPACE_STD
0106 
0107 #endif // _LIBCPP___CXX03___FWD_STRING_H