Path: blob/main/contrib/llvm-project/libcxx/include/__fwd/string.h
35233 views
//===----------------------------------------------------------------------===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef _LIBCPP___FWD_STRING_H9#define _LIBCPP___FWD_STRING_H1011#include <__config>12#include <__fwd/memory.h>13#include <__fwd/memory_resource.h>1415#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)16# pragma GCC system_header17#endif1819_LIBCPP_BEGIN_NAMESPACE_STD2021template <class _CharT>22struct _LIBCPP_TEMPLATE_VIS char_traits;23template <>24struct char_traits<char>;2526#ifndef _LIBCPP_HAS_NO_CHAR8_T27template <>28struct char_traits<char8_t>;29#endif3031template <>32struct char_traits<char16_t>;33template <>34struct char_traits<char32_t>;3536#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS37template <>38struct char_traits<wchar_t>;39#endif4041template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >42class _LIBCPP_TEMPLATE_VIS basic_string;4344using string = basic_string<char>;4546#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS47using wstring = basic_string<wchar_t>;48#endif4950#ifndef _LIBCPP_HAS_NO_CHAR8_T51using u8string = basic_string<char8_t>;52#endif5354using u16string = basic_string<char16_t>;55using u32string = basic_string<char32_t>;5657#if _LIBCPP_STD_VER >= 175859namespace pmr {60template <class _CharT, class _Traits = char_traits<_CharT>>61using basic_string _LIBCPP_AVAILABILITY_PMR = std::basic_string<_CharT, _Traits, polymorphic_allocator<_CharT>>;6263using string _LIBCPP_AVAILABILITY_PMR = basic_string<char>;6465# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS66using wstring _LIBCPP_AVAILABILITY_PMR = basic_string<wchar_t>;67# endif6869# ifndef _LIBCPP_HAS_NO_CHAR8_T70using u8string _LIBCPP_AVAILABILITY_PMR = basic_string<char8_t>;71# endif7273using u16string _LIBCPP_AVAILABILITY_PMR = basic_string<char16_t>;74using u32string _LIBCPP_AVAILABILITY_PMR = basic_string<char32_t>;75} // namespace pmr7677#endif // _LIBCPP_STD_VER >= 177879// clang-format off80template <class _CharT, class _Traits, class _Allocator>81class _LIBCPP_PREFERRED_NAME(string)82#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS83_LIBCPP_PREFERRED_NAME(wstring)84#endif85#ifndef _LIBCPP_HAS_NO_CHAR8_T86_LIBCPP_PREFERRED_NAME(u8string)87#endif88_LIBCPP_PREFERRED_NAME(u16string)89_LIBCPP_PREFERRED_NAME(u32string)90#if _LIBCPP_STD_VER >= 1791_LIBCPP_PREFERRED_NAME(pmr::string)92# ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS93_LIBCPP_PREFERRED_NAME(pmr::wstring)94# endif95# ifndef _LIBCPP_HAS_NO_CHAR8_T96_LIBCPP_PREFERRED_NAME(pmr::u8string)97# endif98_LIBCPP_PREFERRED_NAME(pmr::u16string)99_LIBCPP_PREFERRED_NAME(pmr::u32string)100#endif101basic_string;102// clang-format on103104_LIBCPP_END_NAMESPACE_STD105106#endif // _LIBCPP___FWD_STRING_H107108109