From Jason Turner

[ospanstream]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpq5heuo0r/{from.md → to.md} +105 -0
tmp/tmpq5heuo0r/{from.md → to.md} RENAMED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Class template `basic_ospanstream` <a id="ospanstream">[[ospanstream]]</a>
2
+
3
+ #### General <a id="ospanstream.general">[[ospanstream.general]]</a>
4
+
5
+ ``` cpp
6
+ namespace std {
7
+ template<class charT, class traits = char_traits<charT>>
8
+ class basic_ospanstream
9
+ : public basic_ostream<charT, traits> {
10
+ public:
11
+ using char_type = charT;
12
+ using int_type = typename traits::int_type;
13
+ using pos_type = typename traits::pos_type;
14
+ using off_type = typename traits::off_type;
15
+ using traits_type = traits;
16
+
17
+ // [ospanstream.cons], constructors
18
+ explicit basic_ospanstream(std::span<charT> s,
19
+ ios_base::openmode which = ios_base::out);
20
+ basic_ospanstream(const basic_ospanstream&) = delete;
21
+ basic_ospanstream(basic_ospanstream&& rhs);
22
+
23
+ basic_ospanstream& operator=(const basic_ospanstream&) = delete;
24
+ basic_ospanstream& operator=(basic_ospanstream&& rhs);
25
+
26
+ // [ospanstream.swap], swap
27
+ void swap(basic_ospanstream& rhs);
28
+
29
+ // [ospanstream.members], member functions
30
+ basic_spanbuf<charT, traits>* rdbuf() const noexcept;
31
+
32
+ std::span<charT> span() const noexcept;
33
+ void span(std::span<charT> s) noexcept;
34
+
35
+ private:
36
+ basic_spanbuf<charT, traits> sb; // exposition only
37
+ };
38
+ }
39
+ ```
40
+
41
+ #### Constructors <a id="ospanstream.cons">[[ospanstream.cons]]</a>
42
+
43
+ ``` cpp
44
+ explicit basic_ospanstream(std::span<charT> s,
45
+ ios_base::openmode which = ios_base::out);
46
+ ```
47
+
48
+ *Effects:* Initializes the base class with
49
+ `basic_ostream<charT, traits>(addressof(sb))` and `sb` with
50
+ `basic_spanbuf<charT, traits>(s, which | ios_base::out)`
51
+ [[spanbuf.cons]].
52
+
53
+ ``` cpp
54
+ basic_ospanstream(basic_ospanstream&& rhs) noexcept;
55
+ ```
56
+
57
+ *Effects:* Initializes the base class with `std::move(rhs)` and `sb`
58
+ with `std::move(rhs.sb)`. Next,
59
+ `basic_ostream<charT, traits>::set_rdbuf(addressof(sb))` is called to
60
+ install the contained `basic_spanbuf`.
61
+
62
+ #### Swap <a id="ospanstream.swap">[[ospanstream.swap]]</a>
63
+
64
+ ``` cpp
65
+ void swap(basic_ospanstream& rhs);
66
+ ```
67
+
68
+ *Effects:* Equivalent to:
69
+
70
+ ``` cpp
71
+ basic_ostream<charT, traits>::swap(rhs);
72
+ sb.swap(rhs.sb);
73
+ ```
74
+
75
+ ``` cpp
76
+ template<class charT, class traits>
77
+ void swap(basic_ospanstream<charT, traits>& x, basic_ospanstream<charT, traits>& y);
78
+ ```
79
+
80
+ *Effects:* Equivalent to `x.swap(y)`.
81
+
82
+ #### Member functions <a id="ospanstream.members">[[ospanstream.members]]</a>
83
+
84
+ ``` cpp
85
+ basic_spanbuf<charT, traits>* rdbuf() const noexcept;
86
+ ```
87
+
88
+ *Effects:* Equivalent to:
89
+
90
+ ``` cpp
91
+ return const_cast<basic_spanbuf<charT, traits>*>(addressof(sb));
92
+ ```
93
+
94
+ ``` cpp
95
+ std::span<charT> span() const noexcept;
96
+ ```
97
+
98
+ *Effects:* Equivalent to: `return rdbuf()->span();`
99
+
100
+ ``` cpp
101
+ void span(std::span<charT> s) noexcept;
102
+ ```
103
+
104
+ *Effects:* Equivalent to `rdbuf()->span(s)`.
105
+