diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2018-12-11 04:35:44 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2018-12-11 04:35:44 +0000 |
| commit | 7dad0bd68bf780b08b70c02a3b88374abfa6c152 (patch) | |
| tree | f3dc02cfe3636fcb6bea07d6eba9e0c80aa71c33 /libcxx/include/string | |
| parent | 6368818fd572b49ecb062906ed4a379bca4447df (diff) | |
| download | bcm5719-llvm-7dad0bd68bf780b08b70c02a3b88374abfa6c152.tar.gz bcm5719-llvm-7dad0bd68bf780b08b70c02a3b88374abfa6c152.zip | |
Second part of P0482 - char8_t. Reviewed as https://reviews.llvm.org/D55308
llvm-svn: 348828
Diffstat (limited to 'libcxx/include/string')
| -rw-r--r-- | libcxx/include/string | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/libcxx/include/string b/libcxx/include/string index 31ad307e57b..4dd6ddc4e92 100644 --- a/libcxx/include/string +++ b/libcxx/include/string @@ -4170,11 +4170,13 @@ swap(basic_string<_CharT, _Traits, _Allocator>& __lhs, __lhs.swap(__rhs); } -#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS +#ifndef _LIBCPP_NO_HAS_CHAR8_T +typedef basic_string<char8_t> u8string; +#endif +#ifndef _LIBCPP_HAS_NO_UNICODE_CHARS typedef basic_string<char16_t> u16string; typedef basic_string<char32_t> u32string; - #endif // _LIBCPP_HAS_NO_UNICODE_CHARS _LIBCPP_FUNC_VIS int stoi (const string& __str, size_t* __idx = 0, int __base = 10); @@ -4331,6 +4333,14 @@ inline namespace literals return basic_string<wchar_t> (__str, __len); } +#ifndef _LIBCPP_NO_HAS_CHAR8_T + inline _LIBCPP_INLINE_VISIBILITY + basic_string<char8_t> operator "" s(const char8_t *__str, size_t __len) _NOEXCEPT + { + return basic_string<char8_t> (__str, __len); + } +#endif + inline _LIBCPP_INLINE_VISIBILITY basic_string<char16_t> operator "" s( const char16_t *__str, size_t __len ) { |

