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_view | |
| 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_view')
| -rw-r--r-- | libcxx/include/string_view | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/libcxx/include/string_view b/libcxx/include/string_view index dd425a2e864..7d783122f12 100644 --- a/libcxx/include/string_view +++ b/libcxx/include/string_view @@ -769,6 +769,9 @@ bool operator>=(typename common_type<basic_string_view<_CharT, _Traits> >::type } typedef basic_string_view<char> string_view; +#ifndef _LIBCPP_NO_HAS_CHAR8_T +typedef basic_string_view<char8_t> u8string_view; +#endif typedef basic_string_view<char16_t> u16string_view; typedef basic_string_view<char32_t> u32string_view; typedef basic_string_view<wchar_t> wstring_view; @@ -802,6 +805,14 @@ inline namespace literals return basic_string_view<wchar_t> (__str, __len); } +#ifndef _LIBCPP_NO_HAS_CHAR8_T + inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR + basic_string_view<char8_t> operator "" sv(const char8_t *__str, size_t __len) _NOEXCEPT + { + return basic_string_view<char8_t> (__str, __len); + } +#endif + inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR basic_string_view<char16_t> operator "" sv(const char16_t *__str, size_t __len) _NOEXCEPT { |

