aboutsummaryrefslogtreecommitdiffstats
path: root/include/string_view
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2019-10-23 17:52:30 +0000
committerDimitry Andric <dim@FreeBSD.org>2019-10-23 17:52:30 +0000
commit243a6be085fe6a7ce49169864c68a8839735e49b (patch)
treeabfecf3c23dc7512ca48e72ac418b149c865e0f3 /include/string_view
parent1147845301c03308e3419b89c28c77bb6917fe04 (diff)
downloadsrc-vendor/libc++.tar.gz
src-vendor/libc++.zip
Vendor import of stripped libc++ trunk r375505, the last commit beforevendor/libc++/libc++-trunk-r375505vendor/libc++
the upstream Subversion repository was made read-only, and the LLVM project migrated to GitHub: https://llvm.org/svn/llvm-project/libcxx/trunk@375505
Notes
Notes: svn path=/vendor/libc++/dist/; revision=353946 svn path=/vendor/libc++/libc++-r375505/; revision=353947; tag=vendor/libc++/libc++-trunk-r375505
Diffstat (limited to 'include/string_view')
-rw-r--r--include/string_view9
1 files changed, 8 insertions, 1 deletions
diff --git a/include/string_view b/include/string_view
index 04448312ff33..8a684a8f966c 100644
--- a/include/string_view
+++ b/include/string_view
@@ -173,6 +173,7 @@ namespace std {
#include <__config>
#include <__string>
+#include <iosfwd>
#include <algorithm>
#include <iterator>
#include <limits>
@@ -235,7 +236,7 @@ public:
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
basic_string_view(const _CharT* __s)
- : __data(__s), __size(_Traits::length(__s)) {}
+ : __data(__s), __size(std::__char_traits_length_checked<_Traits>(__s)) {}
// [string.view.iterators], iterators
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
@@ -767,6 +768,12 @@ bool operator>=(typename common_type<basic_string_view<_CharT, _Traits> >::type
return __lhs.compare(__rhs) >= 0;
}
+
+template<class _CharT, class _Traits>
+basic_ostream<_CharT, _Traits>&
+operator<<(basic_ostream<_CharT, _Traits>& __os,
+ basic_string_view<_CharT, _Traits> __str);
+
typedef basic_string_view<char> string_view;
#ifndef _LIBCPP_NO_HAS_CHAR8_T
typedef basic_string_view<char8_t> u8string_view;