tmp/tmp0oq6ua5a/{from.md → to.md}
RENAMED
|
@@ -1,17 +1,16 @@
|
|
| 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 =
|
| 11 |
-
using pos_type =
|
| 12 |
-
using 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) {}
|
|
@@ -33,10 +32,17 @@ namespace std {
|
|
| 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);
|
|
@@ -55,13 +61,15 @@ namespace std {
|
|
| 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;
|
| 63 |
};
|
| 64 |
}
|
| 65 |
```
|
| 66 |
|
| 67 |
The class template `basic_stringstream<charT, traits>` supports reading
|
|
@@ -69,7 +77,7 @@ 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 |
|
|
|
|
| 1 |
#### General <a id="stringstream.general">[[stringstream.general]]</a>
|
| 2 |
|
| 3 |
``` cpp
|
| 4 |
namespace std {
|
| 5 |
+
template<class charT, class traits = char_traits<charT>, class Allocator = allocator<charT>>
|
|
|
|
| 6 |
class basic_stringstream : public basic_iostream<charT, traits> {
|
| 7 |
public:
|
| 8 |
using char_type = charT;
|
| 9 |
+
using int_type = traits::int_type;
|
| 10 |
+
using pos_type = traits::pos_type;
|
| 11 |
+
using off_type = traits::off_type;
|
| 12 |
using traits_type = traits;
|
| 13 |
using allocator_type = Allocator;
|
| 14 |
|
| 15 |
// [stringstream.cons], constructors
|
| 16 |
basic_stringstream() : basic_stringstream(ios_base::out | ios_base::in) {}
|
|
|
|
| 32 |
ios_base::openmode which, const Allocator& a);
|
| 33 |
template<class SAlloc>
|
| 34 |
explicit basic_stringstream(
|
| 35 |
const basic_string<charT, traits, SAlloc>& s,
|
| 36 |
ios_base::openmode which = ios_base::out | ios_base::in);
|
| 37 |
+
template<class T>
|
| 38 |
+
explicit basic_stringstream(const T& t,
|
| 39 |
+
ios_base::openmode which = ios_base::out | ios_base::in);
|
| 40 |
+
template<class T>
|
| 41 |
+
basic_stringstream(const T& t, const Allocator& a);
|
| 42 |
+
template<class T>
|
| 43 |
+
basic_stringstream(const T& t, ios_base::openmode which, const Allocator& a);
|
| 44 |
basic_stringstream(const basic_stringstream&) = delete;
|
| 45 |
basic_stringstream(basic_stringstream&& rhs);
|
| 46 |
|
| 47 |
basic_stringstream& operator=(const basic_stringstream&) = delete;
|
| 48 |
basic_stringstream& operator=(basic_stringstream&& rhs);
|
|
|
|
| 61 |
|
| 62 |
void str(const basic_string<charT, traits, Allocator>& s);
|
| 63 |
template<class SAlloc>
|
| 64 |
void str(const basic_string<charT, traits, SAlloc>& s);
|
| 65 |
void str(basic_string<charT, traits, Allocator>&& s);
|
| 66 |
+
template<class T>
|
| 67 |
+
void str(const T& t);
|
| 68 |
|
| 69 |
private:
|
| 70 |
+
basic_stringbuf<charT, traits, Allocator> sb; // exposition only
|
| 71 |
};
|
| 72 |
}
|
| 73 |
```
|
| 74 |
|
| 75 |
The class template `basic_stringstream<charT, traits>` supports reading
|
|
|
|
| 77 |
`basic_string<charT, traits, Allocator>`. It uses a
|
| 78 |
`basic_stringbuf<charT, traits, Allocator>` object to control the
|
| 79 |
associated sequence. For the sake of exposition, the maintained data is
|
| 80 |
presented here as
|
| 81 |
|
| 82 |
+
- *`sb`*, the `stringbuf` object.
|
| 83 |
|