From Jason Turner

[ostringstream.general]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpa25fyv3b/{from.md → to.md} +73 -0
tmp/tmpa25fyv3b/{from.md → to.md} RENAMED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### General <a id="ostringstream.general">[[ostringstream.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_ostringstream : public basic_ostream<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
+ // [ostringstream.cons], constructors
17
+ basic_ostringstream() : basic_ostringstream(ios_base::out) {}
18
+ explicit basic_ostringstream(ios_base::openmode which);
19
+ explicit basic_ostringstream(
20
+ const basic_string<charT, traits, Allocator>& s,
21
+ ios_base::openmode which = ios_base::out);
22
+ basic_ostringstream(ios_base::openmode which, const Allocator& a);
23
+ explicit basic_ostringstream(
24
+ basic_string<charT, traits, Allocator>&& s,
25
+ ios_base::openmode which = ios_base::out);
26
+ template<class SAlloc>
27
+ basic_ostringstream(
28
+ const basic_string<charT, traits, SAlloc>& s, const Allocator& a)
29
+ : basic_ostringstream(s, ios_base::out, a) {}
30
+ template<class SAlloc>
31
+ basic_ostringstream(
32
+ const basic_string<charT, traits, SAlloc>& s,
33
+ ios_base::openmode which, const Allocator& a);
34
+ template<class SAlloc>
35
+ explicit basic_ostringstream(
36
+ const basic_string<charT, traits, SAlloc>& s,
37
+ ios_base::openmode which = ios_base::out);
38
+ basic_ostringstream(const basic_ostringstream&) = delete;
39
+ basic_ostringstream(basic_ostringstream&& rhs);
40
+
41
+ basic_ostringstream& operator=(const basic_ostringstream&) = delete;
42
+ basic_ostringstream& operator=(basic_ostringstream&& rhs);
43
+
44
+ // [ostringstream.swap], swap
45
+ void swap(basic_ostringstream& rhs);
46
+
47
+ // [ostringstream.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, Allocator> sb; // exposition only
63
+ };
64
+ }
65
+ ```
66
+
67
+ The class `basic_ostringstream<charT, traits, Allocator>` supports
68
+ writing objects of class `basic_string<{}charT, traits, Allocator>`. It
69
+ uses a `basic_stringbuf` object to control the associated storage. For
70
+ the sake of exposition, the maintained data is presented here as:
71
+
72
+ - `sb`, the `stringbuf` object.
73
+