diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2018-09-19 18:29:57 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2018-09-19 18:29:57 +0000 |
| commit | 4a71f9cfcc0369d8b90412ab09ef7ae812440ef1 (patch) | |
| tree | 6ee9a8cb973b2fc59a8695bc178f37c30faf91a2 /libcxx/include | |
| parent | 29bf94d86fba0babf426e3d25abaae24dd9971bd (diff) | |
| download | bcm5719-llvm-4a71f9cfcc0369d8b90412ab09ef7ae812440ef1.tar.gz bcm5719-llvm-4a71f9cfcc0369d8b90412ab09ef7ae812440ef1.zip | |
Implement LWG 2221 - No formatted output operator for nullptr. Reviewed as https://reviews.llvm.org/D44263
llvm-svn: 342566
Diffstat (limited to 'libcxx/include')
| -rw-r--r-- | libcxx/include/ostream | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libcxx/include/ostream b/libcxx/include/ostream index 5404e0dca6c..c29157077b4 100644 --- a/libcxx/include/ostream +++ b/libcxx/include/ostream @@ -56,6 +56,7 @@ public: basic_ostream& operator<<(double f); basic_ostream& operator<<(long double f); basic_ostream& operator<<(const void* p); + basic_ostream<charT, traits>& operator<<(nullptr_t); // C++17 basic_ostream& operator<<(basic_streambuf<char_type,traits>* sb); // 27.7.2.7 Unformatted output: @@ -216,6 +217,7 @@ public: basic_ostream& operator<<(double __f); basic_ostream& operator<<(long double __f); basic_ostream& operator<<(const void* __p); + basic_ostream& operator<<(nullptr_t); basic_ostream& operator<<(basic_streambuf<char_type, traits_type>* __sb); // 27.7.2.7 Unformatted output: @@ -709,6 +711,14 @@ basic_ostream<_CharT, _Traits>::operator<<(const void* __n) return *this; } +template <class _CharT, class _Traits> +basic_ostream<_CharT, _Traits>& +basic_ostream<_CharT, _Traits>::operator<<(nullptr_t) +{ + return *this << "(nullptr)"; +} + + template<class _CharT, class _Traits> basic_ostream<_CharT, _Traits>& __put_character_sequence(basic_ostream<_CharT, _Traits>& __os, @@ -742,7 +752,6 @@ __put_character_sequence(basic_ostream<_CharT, _Traits>& __os, return __os; } - template<class _CharT, class _Traits> basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c) |

