diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-05-10 13:03:14 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-05-10 16:40:22 +0100 |
commit | 1807e07825a86916bbfddca470708c5a8f613612 (patch) | |
tree | 6112d59575206a018ff9f04894f0991b30e530f3 /libstdc++-v3/include | |
parent | 098f02aa154b308111cc1f520a577f5bb5f08377 (diff) | |
download | gcc-1807e07825a86916bbfddca470708c5a8f613612.tar.gz |
libstdc++: Add <syncstream> declarations to <iosfwd> [PR105284]
libstdc++-v3/ChangeLog:
PR libstdc++/105284
* include/std/iosfwd: Add declarations for <synstream> class
templates and typedefs.
* include/std/syncstream (basic_syncbuf, basic_osyncstream):
Remove default template arguments.
* testsuite/27_io/headers/iosfwd/synopsis.cc: New test.
* testsuite/27_io/headers/iosfwd/types.cc: New test.
Diffstat (limited to 'libstdc++-v3/include')
-rw-r--r-- | libstdc++-v3/include/std/iosfwd | 18 | ||||
-rw-r--r-- | libstdc++-v3/include/std/syncstream | 6 |
2 files changed, 20 insertions, 4 deletions
diff --git a/libstdc++-v3/include/std/iosfwd b/libstdc++-v3/include/std/iosfwd index 2d79a131631..c8c67c86c3b 100644 --- a/libstdc++-v3/include/std/iosfwd +++ b/libstdc++-v3/include/std/iosfwd @@ -207,6 +207,24 @@ _GLIBCXX_END_NAMESPACE_CXX11 /// Class for @c wchar_t mixed input and output file streams. typedef basic_fstream<wchar_t> wfstream; #endif + +#if __cplusplus >= 202002L && _GLIBCXX_USE_CXX11_ABI + template<typename _CharT, typename _Traits = char_traits<_CharT>, + typename _Allocator = allocator<_CharT>> + class basic_syncbuf; + template<typename _CharT, typename _Traits = char_traits<_CharT>, + typename _Allocator = allocator<_CharT>> + class basic_osyncstream; + + using syncbuf = basic_syncbuf<char>; + using osyncstream = basic_osyncstream<char>; + +#ifdef _GLIBCXX_USE_WCHAR_T + using wsyncbuf = basic_syncbuf<wchar_t>; + using wosyncstream = basic_osyncstream<wchar_t>; +#endif +#endif // C++20 && CXX11_ABI + /** @} */ _GLIBCXX_END_NAMESPACE_VERSION diff --git a/libstdc++-v3/include/std/syncstream b/libstdc++-v3/include/std/syncstream index 3cf2296f723..7a4f731ddd9 100644 --- a/libstdc++-v3/include/std/syncstream +++ b/libstdc++-v3/include/std/syncstream @@ -50,8 +50,7 @@ namespace std _GLIBCXX_VISIBILITY(default) { _GLIBCXX_BEGIN_NAMESPACE_VERSION - template<typename _CharT, typename _Traits = char_traits<_CharT>, - typename _Alloc = allocator<_CharT>> + template<typename _CharT, typename _Traits, typename _Alloc> class basic_syncbuf : public __syncbuf_base<_CharT, _Traits> { public: @@ -241,8 +240,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION __mutex _M_mtx; }; - template <typename _CharT, typename _Traits = char_traits<_CharT>, - typename _Alloc = allocator<_CharT>> + template <typename _CharT, typename _Traits, typename _Alloc> class basic_osyncstream : public basic_ostream<_CharT, _Traits> { using __ostream_type = basic_ostream<_CharT, _Traits>; |