74 lines · c
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9#ifndef _LIBCPP___CXX03___FWD_STRING_H10#define _LIBCPP___CXX03___FWD_STRING_H11 12#include <__cxx03/__config>13#include <__cxx03/__fwd/memory.h>14 15#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)16# pragma GCC system_header17#endif18 19_LIBCPP_BEGIN_NAMESPACE_STD20 21template <class _CharT>22struct _LIBCPP_TEMPLATE_VIS char_traits;23template <>24struct char_traits<char>;25 26#ifndef _LIBCPP_HAS_NO_CHAR8_T27template <>28struct char_traits<char8_t>;29#endif30 31template <>32struct char_traits<char16_t>;33template <>34struct char_traits<char32_t>;35 36#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS37template <>38struct char_traits<wchar_t>;39#endif40 41template <class _CharT, class _Traits = char_traits<_CharT>, class _Allocator = allocator<_CharT> >42class _LIBCPP_TEMPLATE_VIS basic_string;43 44using string = basic_string<char>;45 46#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS47using wstring = basic_string<wchar_t>;48#endif49 50#ifndef _LIBCPP_HAS_NO_CHAR8_T51using u8string = basic_string<char8_t>;52#endif53 54using u16string = basic_string<char16_t>;55using u32string = basic_string<char32_t>;56 57// clang-format off58template <class _CharT, class _Traits, class _Allocator>59class _LIBCPP_PREFERRED_NAME(string)60#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS61 _LIBCPP_PREFERRED_NAME(wstring)62#endif63#ifndef _LIBCPP_HAS_NO_CHAR8_T64 _LIBCPP_PREFERRED_NAME(u8string)65#endif66 _LIBCPP_PREFERRED_NAME(u16string)67 _LIBCPP_PREFERRED_NAME(u32string)68 basic_string;69// clang-format on70 71_LIBCPP_END_NAMESPACE_STD72 73#endif // _LIBCPP___CXX03___FWD_STRING_H74