tmp/tmp3xlal3oj/{from.md → to.md}
RENAMED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
### Class template `basic_ostringstream` <a id="ostringstream">[[ostringstream]]</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> {
|
|
@@ -36,13 +38,14 @@ namespace std {
|
|
| 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 |
-
// [ostringstream.assign], assign and swap
|
| 42 |
basic_ostringstream& operator=(const basic_ostringstream&) = delete;
|
| 43 |
basic_ostringstream& operator=(basic_ostringstream&& rhs);
|
|
|
|
|
|
|
| 44 |
void swap(basic_ostringstream& rhs);
|
| 45 |
|
| 46 |
// [ostringstream.members], members
|
| 47 |
basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
|
| 48 |
|
|
@@ -58,14 +61,10 @@ namespace std {
|
|
| 58 |
void str(basic_string<charT, traits, Allocator>&& s);
|
| 59 |
|
| 60 |
private:
|
| 61 |
basic_stringbuf<charT, traits, Allocator> sb; // exposition only
|
| 62 |
};
|
| 63 |
-
|
| 64 |
-
template<class charT, class traits, class Allocator>
|
| 65 |
-
void swap(basic_ostringstream<charT, traits, Allocator>& x,
|
| 66 |
-
basic_ostringstream<charT, traits, Allocator>& y);
|
| 67 |
}
|
| 68 |
```
|
| 69 |
|
| 70 |
The class `basic_ostringstream<charT, traits, Allocator>` supports
|
| 71 |
writing objects of class `basic_string<{}charT, traits, Allocator>`. It
|
|
@@ -91,19 +90,21 @@ explicit basic_ostringstream(
|
|
| 91 |
ios_base::openmode which = ios_base::out);
|
| 92 |
```
|
| 93 |
|
| 94 |
*Effects:* Initializes the base class with
|
| 95 |
`basic_ostream<charT, traits>(addressof(sb))` [[ostream]] and `sb` with
|
| 96 |
-
`basic_stringbuf<charT, traits, Allocator>(s, which | ios_base::out)`
|
|
|
|
| 97 |
|
| 98 |
``` cpp
|
| 99 |
basic_ostringstream(ios_base::openmode which, const Allocator& a);
|
| 100 |
```
|
| 101 |
|
| 102 |
*Effects:* Initializes the base class with
|
| 103 |
`basic_ostream<charT, traits>(addressof(sb))` [[ostream]] and `sb` with
|
| 104 |
-
`basic_stringbuf<charT, traits, Allocator>(which | ios_base::out, a)`
|
|
|
|
| 105 |
|
| 106 |
``` cpp
|
| 107 |
explicit basic_ostringstream(
|
| 108 |
basic_string<charT, traits, Allocator>&& s,
|
| 109 |
ios_base::openmode which = ios_base::out);
|
|
@@ -121,11 +122,12 @@ template<class SAlloc>
|
|
| 121 |
ios_base::openmode which, const Allocator& a);
|
| 122 |
```
|
| 123 |
|
| 124 |
*Effects:* Initializes the base class with
|
| 125 |
`basic_ostream<charT, traits>(addressof(sb))` [[ostream]] and `sb` with
|
| 126 |
-
`basic_stringbuf<charT, traits, Allocator>(s, which | ios_base::out, a)`
|
|
|
|
| 127 |
|
| 128 |
``` cpp
|
| 129 |
template<class SAlloc>
|
| 130 |
explicit basic_ostringstream(
|
| 131 |
const basic_string<charT, traits, SAlloc>& s,
|
|
@@ -134,11 +136,12 @@ template<class SAlloc>
|
|
| 134 |
|
| 135 |
*Constraints:* `is_same_v<SAlloc,Allocator>` is `false`.
|
| 136 |
|
| 137 |
*Effects:* Initializes the base class with
|
| 138 |
`basic_ostream<charT, traits>(addressof(sb))` [[ostream]] and `sb` with
|
| 139 |
-
`basic_stringbuf<charT, traits, Allocator>(s, which | ios_base::out)`
|
|
|
|
| 140 |
|
| 141 |
``` cpp
|
| 142 |
basic_ostringstream(basic_ostringstream&& rhs);
|
| 143 |
```
|
| 144 |
|
|
@@ -146,11 +149,11 @@ basic_ostringstream(basic_ostringstream&& rhs);
|
|
| 146 |
by move constructing the base class, and the contained
|
| 147 |
`basic_stringbuf`. Then calls
|
| 148 |
`basic_ostream<charT, traits>::set_rdbuf(addressof(sb))` to install the
|
| 149 |
contained `basic_stringbuf`.
|
| 150 |
|
| 151 |
-
####
|
| 152 |
|
| 153 |
``` cpp
|
| 154 |
void swap(basic_ostringstream& rhs);
|
| 155 |
```
|
| 156 |
|
|
|
|
| 1 |
### Class template `basic_ostringstream` <a id="ostringstream">[[ostringstream]]</a>
|
| 2 |
|
| 3 |
+
#### General <a id="ostringstream.general">[[ostringstream.general]]</a>
|
| 4 |
+
|
| 5 |
``` cpp
|
| 6 |
namespace std {
|
| 7 |
template<class charT, class traits = char_traits<charT>,
|
| 8 |
class Allocator = allocator<charT>>
|
| 9 |
class basic_ostringstream : public basic_ostream<charT, traits> {
|
|
|
|
| 38 |
const basic_string<charT, traits, SAlloc>& s,
|
| 39 |
ios_base::openmode which = ios_base::out);
|
| 40 |
basic_ostringstream(const basic_ostringstream&) = delete;
|
| 41 |
basic_ostringstream(basic_ostringstream&& rhs);
|
| 42 |
|
|
|
|
| 43 |
basic_ostringstream& operator=(const basic_ostringstream&) = delete;
|
| 44 |
basic_ostringstream& operator=(basic_ostringstream&& rhs);
|
| 45 |
+
|
| 46 |
+
// [ostringstream.swap], swap
|
| 47 |
void swap(basic_ostringstream& rhs);
|
| 48 |
|
| 49 |
// [ostringstream.members], members
|
| 50 |
basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
|
| 51 |
|
|
|
|
| 61 |
void str(basic_string<charT, traits, Allocator>&& s);
|
| 62 |
|
| 63 |
private:
|
| 64 |
basic_stringbuf<charT, traits, Allocator> sb; // exposition only
|
| 65 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
| 66 |
}
|
| 67 |
```
|
| 68 |
|
| 69 |
The class `basic_ostringstream<charT, traits, Allocator>` supports
|
| 70 |
writing objects of class `basic_string<{}charT, traits, Allocator>`. It
|
|
|
|
| 90 |
ios_base::openmode which = ios_base::out);
|
| 91 |
```
|
| 92 |
|
| 93 |
*Effects:* Initializes the base class with
|
| 94 |
`basic_ostream<charT, traits>(addressof(sb))` [[ostream]] and `sb` with
|
| 95 |
+
`basic_stringbuf<charT, traits, Allocator>(s, which | ios_base::out)`
|
| 96 |
+
[[stringbuf.cons]].
|
| 97 |
|
| 98 |
``` cpp
|
| 99 |
basic_ostringstream(ios_base::openmode which, const Allocator& a);
|
| 100 |
```
|
| 101 |
|
| 102 |
*Effects:* Initializes the base class with
|
| 103 |
`basic_ostream<charT, traits>(addressof(sb))` [[ostream]] and `sb` with
|
| 104 |
+
`basic_stringbuf<charT, traits, Allocator>(which | ios_base::out, a)`
|
| 105 |
+
[[stringbuf.cons]].
|
| 106 |
|
| 107 |
``` cpp
|
| 108 |
explicit basic_ostringstream(
|
| 109 |
basic_string<charT, traits, Allocator>&& s,
|
| 110 |
ios_base::openmode which = ios_base::out);
|
|
|
|
| 122 |
ios_base::openmode which, const Allocator& a);
|
| 123 |
```
|
| 124 |
|
| 125 |
*Effects:* Initializes the base class with
|
| 126 |
`basic_ostream<charT, traits>(addressof(sb))` [[ostream]] and `sb` with
|
| 127 |
+
`basic_stringbuf<charT, traits, Allocator>(s, which | ios_base::out, a)`
|
| 128 |
+
[[stringbuf.cons]].
|
| 129 |
|
| 130 |
``` cpp
|
| 131 |
template<class SAlloc>
|
| 132 |
explicit basic_ostringstream(
|
| 133 |
const basic_string<charT, traits, SAlloc>& s,
|
|
|
|
| 136 |
|
| 137 |
*Constraints:* `is_same_v<SAlloc,Allocator>` is `false`.
|
| 138 |
|
| 139 |
*Effects:* Initializes the base class with
|
| 140 |
`basic_ostream<charT, traits>(addressof(sb))` [[ostream]] and `sb` with
|
| 141 |
+
`basic_stringbuf<charT, traits, Allocator>(s, which | ios_base::out)`
|
| 142 |
+
[[stringbuf.cons]].
|
| 143 |
|
| 144 |
``` cpp
|
| 145 |
basic_ostringstream(basic_ostringstream&& rhs);
|
| 146 |
```
|
| 147 |
|
|
|
|
| 149 |
by move constructing the base class, and the contained
|
| 150 |
`basic_stringbuf`. Then calls
|
| 151 |
`basic_ostream<charT, traits>::set_rdbuf(addressof(sb))` to install the
|
| 152 |
contained `basic_stringbuf`.
|
| 153 |
|
| 154 |
+
#### Swap <a id="ostringstream.swap">[[ostringstream.swap]]</a>
|
| 155 |
|
| 156 |
``` cpp
|
| 157 |
void swap(basic_ostringstream& rhs);
|
| 158 |
```
|
| 159 |
|