From Jason Turner

[stringstream.general]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpejeomf1g/{from.md → to.md} +75 -0
tmp/tmpejeomf1g/{from.md → to.md} RENAMED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### General <a id="stringstream.general">[[stringstream.general]]</a>
2
+
3
+ ``` cpp
4
+ namespace std {
5
+ template<class charT, class traits = char_traits<charT>,
6
+ class Allocator = allocator<charT>>
7
+ class basic_stringstream : public basic_iostream<charT, traits> {
8
+ public:
9
+ using char_type = charT;
10
+ using int_type = typename traits::int_type;
11
+ using pos_type = typename traits::pos_type;
12
+ using off_type = typename traits::off_type;
13
+ using traits_type = traits;
14
+ using allocator_type = Allocator;
15
+
16
+ // [stringstream.cons], constructors
17
+ basic_stringstream() : basic_stringstream(ios_base::out | ios_base::in) {}
18
+ explicit basic_stringstream(ios_base::openmode which);
19
+ explicit basic_stringstream(
20
+ const basic_string<charT, traits, Allocator>& s,
21
+ ios_base::openmode which = ios_base::out | ios_base::in);
22
+ basic_stringstream(ios_base::openmode which, const Allocator& a);
23
+ explicit basic_stringstream(
24
+ basic_string<charT, traits, Allocator>&& s,
25
+ ios_base::openmode which = ios_base::out | ios_base::in);
26
+ template<class SAlloc>
27
+ basic_stringstream(
28
+ const basic_string<charT, traits, SAlloc>& s, const Allocator& a)
29
+ : basic_stringstream(s, ios_base::out | ios_base::in, a) {}
30
+ template<class SAlloc>
31
+ basic_stringstream(
32
+ const basic_string<charT, traits, SAlloc>& s,
33
+ ios_base::openmode which, const Allocator& a);
34
+ template<class SAlloc>
35
+ explicit basic_stringstream(
36
+ const basic_string<charT, traits, SAlloc>& s,
37
+ ios_base::openmode which = ios_base::out | ios_base::in);
38
+ basic_stringstream(const basic_stringstream&) = delete;
39
+ basic_stringstream(basic_stringstream&& rhs);
40
+
41
+ basic_stringstream& operator=(const basic_stringstream&) = delete;
42
+ basic_stringstream& operator=(basic_stringstream&& rhs);
43
+
44
+ // [stringstream.swap], swap
45
+ void swap(basic_stringstream& rhs);
46
+
47
+ // [stringstream.members], members
48
+ basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
49
+
50
+ basic_string<charT, traits, Allocator> str() const &;
51
+ template<class SAlloc>
52
+ basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
53
+ basic_string<charT, traits, Allocator> str() &&;
54
+ basic_string_view<charT, traits> view() const noexcept;
55
+
56
+ void str(const basic_string<charT, traits, Allocator>& s);
57
+ template<class SAlloc>
58
+ void str(const basic_string<charT, traits, SAlloc>& s);
59
+ void str(basic_string<charT, traits, Allocator>&& s);
60
+
61
+ private:
62
+ basic_stringbuf<charT, traits> sb; // exposition only
63
+ };
64
+ }
65
+ ```
66
+
67
+ The class template `basic_stringstream<charT, traits>` supports reading
68
+ and writing from objects of class
69
+ `basic_string<charT, traits, Allocator>`. It uses a
70
+ `basic_stringbuf<charT, traits, Allocator>` object to control the
71
+ associated sequence. For the sake of exposition, the maintained data is
72
+ presented here as
73
+
74
+ - `sb`, the `stringbuf` object.
75
+