diff options
author | Eric Fiselier <eric@efcs.ca> | 2019-09-25 18:56:54 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2019-09-25 18:56:54 +0000 |
commit | af4a29af0179995a9d639af45d2c7bacab61f2b0 (patch) | |
tree | 4004b7362f2faccf8a22fab6223243879144d2db /libcxx/include | |
parent | 374c04e25733e2a5e07c8151bb6ead71ceab528f (diff) | |
download | bcm5719-llvm-af4a29af0179995a9d639af45d2c7bacab61f2b0.tar.gz bcm5719-llvm-af4a29af0179995a9d639af45d2c7bacab61f2b0.zip |
Add forward declaration of operator<< in <string_view> as required.
This declaration was previously missing despite appearing in the
synopsis. Users are still required to include <ostream> to get the
definition of the streaming operator.
llvm-svn: 372909
Diffstat (limited to 'libcxx/include')
-rw-r--r-- | libcxx/include/ostream | 2 | ||||
-rw-r--r-- | libcxx/include/string_view | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libcxx/include/ostream b/libcxx/include/ostream index e6cf9c970f7..ea3870532f3 100644 --- a/libcxx/include/ostream +++ b/libcxx/include/ostream @@ -1055,7 +1055,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, template<class _CharT, class _Traits> basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, - const basic_string_view<_CharT, _Traits> __sv) + basic_string_view<_CharT, _Traits> __sv) { return _VSTD::__put_character_sequence(__os, __sv.data(), __sv.size()); } diff --git a/libcxx/include/string_view b/libcxx/include/string_view index 3a30db8b17b..8a684a8f966 100644 --- a/libcxx/include/string_view +++ b/libcxx/include/string_view @@ -173,6 +173,7 @@ namespace std { #include <__config> #include <__string> +#include <iosfwd> #include <algorithm> #include <iterator> #include <limits> @@ -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; |