diff --git a/libcxx/include/sstream b/libcxx/include/sstream index 3bd5663517590d..91d1a07353aa43 100644 --- a/libcxx/include/sstream +++ b/libcxx/include/sstream @@ -11,8 +11,9 @@ #define _LIBCPP_SSTREAM /* - sstream synopsis + sstream synopsis [sstream.syn] +// Class template basic_stringbuf [stringbuf] template , class Allocator = allocator > class basic_stringbuf : public basic_streambuf @@ -25,7 +26,7 @@ public: typedef typename traits_type::off_type off_type; typedef Allocator allocator_type; - // 27.8.1.1 [stringbuf.cons], constructors: + // [stringbuf.cons] constructors: explicit basic_stringbuf(ios_base::openmode which = ios_base::in | ios_base::out); // before C++20 basic_stringbuf() : basic_stringbuf(ios_base::in | ios_base::out) {} // C++20 explicit basic_stringbuf(ios_base::openmode which); // C++20 @@ -33,16 +34,16 @@ public: ios_base::openmode which = ios_base::in | ios_base::out); basic_stringbuf(basic_stringbuf&& rhs); - // 27.8.1.2 Assign and swap: + // [stringbuf.assign] Assign and swap: basic_stringbuf& operator=(basic_stringbuf&& rhs); void swap(basic_stringbuf& rhs); - // 27.8.1.3 Get and set: + // [stringbuf.members] Member functions: basic_string str() const; void str(const basic_string& s); protected: - // 27.8.1.4 Overridden virtual functions: + // [stringbuf.virtuals] Overridden virtual functions: virtual int_type underflow(); virtual int_type pbackfail(int_type c = traits_type::eof()); virtual int_type overflow (int_type c = traits_type::eof()); @@ -53,6 +54,7 @@ protected: ios_base::openmode which = ios_base::in | ios_base::out); }; +// [stringbuf.assign] non member swap template void swap(basic_stringbuf& x, basic_stringbuf& y); @@ -60,6 +62,7 @@ template typedef basic_stringbuf stringbuf; typedef basic_stringbuf wstringbuf; +// Class template basic_istringstream [istringstream] template , class Allocator = allocator > class basic_istringstream : public basic_istream @@ -72,7 +75,7 @@ public: typedef typename traits_type::off_type off_type; typedef Allocator allocator_type; - // 27.8.2.1 Constructors: + // [istringstream.cons] Constructors: explicit basic_istringstream(ios_base::openmode which = ios_base::in); // before C++20 basic_istringstream() : basic_istringstream(ios_base::in) {} // C++20 explicit basic_istringstream(ios_base::openmode which); // C++20 @@ -81,11 +84,11 @@ public: ios_base::openmode which = ios_base::in); basic_istringstream(basic_istringstream&& rhs); - // 27.8.2.2 Assign and swap: + // [istringstream.assign] Assign and swap: basic_istringstream& operator=(basic_istringstream&& rhs); void swap(basic_istringstream& rhs); - // 27.8.2.3 Members: + // [istringstream.members] Member functions: basic_stringbuf* rdbuf() const; basic_string str() const; void str(const basic_string& s); @@ -98,6 +101,7 @@ template typedef basic_istringstream istringstream; typedef basic_istringstream wistringstream; +// Class template basic_ostringstream [ostringstream] template , class Allocator = allocator > class basic_ostringstream : public basic_ostream @@ -111,7 +115,7 @@ public: typedef typename traits_type::off_type off_type; typedef Allocator allocator_type; - // 27.8.3.1 Constructors/destructor: + // [ostringstream.cons] Constructors: explicit basic_ostringstream(ios_base::openmode which = ios_base::out); // before C++20 basic_ostringstream() : basic_ostringstream(ios_base::out) {} // C++20 explicit basic_ostringstream(ios_base::openmode which); // C++20 @@ -120,11 +124,11 @@ public: ios_base::openmode which = ios_base::out); basic_ostringstream(basic_ostringstream&& rhs); - // 27.8.3.2 Assign/swap: + // [ostringstream.assign] Assign and swap: basic_ostringstream& operator=(basic_ostringstream&& rhs); void swap(basic_ostringstream& rhs); - // 27.8.3.3 Members: + // [ostringstream.members] Member functions: basic_stringbuf* rdbuf() const; basic_string str() const; void str(const basic_string& s); @@ -137,6 +141,7 @@ template typedef basic_ostringstream ostringstream; typedef basic_ostringstream wostringstream; +// Class template basic_stringstream [stringstream] template , class Allocator = allocator > class basic_stringstream : public basic_iostream @@ -150,7 +155,7 @@ public: typedef typename traits_type::off_type off_type; typedef Allocator allocator_type; - // constructors/destructor + // [stringstream.cons] constructors explicit basic_stringstream(ios_base::openmode which = ios_base::out | ios_base::in); // before C++20 basic_stringstream() : basic_stringstream(ios_base::out | ios_base::in) {} // C++20 explicit basic_stringstream(ios_base::openmode which); // C++20 @@ -159,11 +164,11 @@ public: ios_base::openmode which = ios_base::out|ios_base::in); basic_stringstream(basic_stringstream&& rhs); - // 27.8.5.1 Assign/swap: + // [stringstream.assign] Assign and swap: basic_stringstream& operator=(basic_stringstream&& rhs); void swap(basic_stringstream& rhs); - // Members: + // [stringstream.members] Member functions: basic_stringbuf* rdbuf() const; basic_string str() const; void str(const basic_string& str); @@ -198,7 +203,7 @@ _LIBCPP_PUSH_MACROS _LIBCPP_BEGIN_NAMESPACE_STD -// basic_stringbuf +// Class template basic_stringbuf [stringbuf] template class _LIBCPP_TEMPLATE_VIS basic_stringbuf @@ -221,7 +226,7 @@ private: ios_base::openmode __mode_; public: - // 30.8.2.1 [stringbuf.cons], constructors + // [stringbuf.cons] constructors: _LIBCPP_INLINE_VISIBILITY basic_stringbuf() : __hm_(nullptr), __mode_(ios_base::in | ios_base::out) {} @@ -240,16 +245,16 @@ public: basic_stringbuf(basic_stringbuf&& __rhs); - // 27.8.1.2 Assign and swap: + // [stringbuf.assign] Assign and swap: basic_stringbuf& operator=(basic_stringbuf&& __rhs); void swap(basic_stringbuf& __rhs); - // 27.8.1.3 Get and set: + // [stringbuf.members] Member functions: string_type str() const; void str(const string_type& __s); protected: - // 27.8.1.4 Overridden virtual functions: + // [stringbuf.virtuals] Overridden virtual functions: int_type underflow() override; int_type pbackfail(int_type __c = traits_type::eof()) override; int_type overflow (int_type __c = traits_type::eof()) override; @@ -619,7 +624,7 @@ basic_stringbuf<_CharT, _Traits, _Allocator>::seekoff(off_type __off, return pos_type(__noff); } -// basic_istringstream +// Class template basic_istringstream [istringstream] template class _LIBCPP_TEMPLATE_VIS basic_istringstream @@ -639,7 +644,7 @@ private: basic_stringbuf __sb_; public: - // 30.8.3.1 [istringstream.cons], constructors + // [istringstream.cons] Constructors: _LIBCPP_INLINE_VISIBILITY basic_istringstream() : basic_istream<_CharT, _Traits>(&__sb_), __sb_(ios_base::in) {} @@ -663,7 +668,7 @@ public: basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_); } - // 27.8.2.2 Assign and swap: + // [istringstream.assign] Assign and swap: basic_istringstream& operator=(basic_istringstream&& __rhs) { basic_istream::operator=(_VSTD::move(__rhs)); __sb_ = _VSTD::move(__rhs.__sb_); @@ -675,7 +680,7 @@ public: __sb_.swap(__rhs.__sb_); } - // 27.8.2.3 Members: + // [istringstream.members] Member functions: _LIBCPP_INLINE_VISIBILITY basic_stringbuf* rdbuf() const { return const_cast*>(&__sb_); @@ -699,7 +704,7 @@ swap(basic_istringstream<_CharT, _Traits, _Allocator>& __x, __x.swap(__y); } -// basic_ostringstream +// Class template basic_ostringstream [ostringstream] template class _LIBCPP_TEMPLATE_VIS basic_ostringstream @@ -719,7 +724,7 @@ private: basic_stringbuf __sb_; public: - // 30.8.4.1 [ostringstream.cons], constructors + // [ostringstream.cons] Constructors: _LIBCPP_INLINE_VISIBILITY basic_ostringstream() : basic_ostream<_CharT, _Traits>(&__sb_), __sb_(ios_base::out) {} @@ -743,7 +748,7 @@ public: basic_ostream<_CharT, _Traits>::set_rdbuf(&__sb_); } - // 27.8.2.2 Assign and swap: + // [ostringstream.assign] Assign and swap: basic_ostringstream& operator=(basic_ostringstream&& __rhs) { basic_ostream::operator=(_VSTD::move(__rhs)); __sb_ = _VSTD::move(__rhs.__sb_); @@ -756,7 +761,7 @@ public: __sb_.swap(__rhs.__sb_); } - // 27.8.2.3 Members: + // [ostringstream.members] Member functions: _LIBCPP_INLINE_VISIBILITY basic_stringbuf* rdbuf() const { return const_cast*>(&__sb_); @@ -780,7 +785,7 @@ swap(basic_ostringstream<_CharT, _Traits, _Allocator>& __x, __x.swap(__y); } -// basic_stringstream +// Class template basic_stringstream [stringstream] template class _LIBCPP_TEMPLATE_VIS basic_stringstream @@ -800,7 +805,7 @@ private: basic_stringbuf __sb_; public: - // 30.8.5.1 [stringstream.cons], constructors + // [stringstream.cons] constructors _LIBCPP_INLINE_VISIBILITY basic_stringstream() : basic_iostream<_CharT, _Traits>(&__sb_), __sb_(ios_base::in | ios_base::out) {} @@ -824,7 +829,7 @@ public: basic_istream<_CharT, _Traits>::set_rdbuf(&__sb_); } - // 27.8.2.2 Assign and swap: + // [stringstream.assign] Assign and swap: basic_stringstream& operator=(basic_stringstream&& __rhs) { basic_iostream::operator=(_VSTD::move(__rhs)); __sb_ = _VSTD::move(__rhs.__sb_); @@ -836,7 +841,7 @@ public: __sb_.swap(__rhs.__sb_); } - // 27.8.2.3 Members: + // [stringstream.members] Member functions: _LIBCPP_INLINE_VISIBILITY basic_stringbuf* rdbuf() const { return const_cast*>(&__sb_);