tmp/tmpjc7k6un0/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### General <a id="istringstream.general">[[istringstream.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_istringstream : public basic_istream<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 |
+
// [istringstream.cons], constructors
|
| 17 |
+
basic_istringstream() : basic_istringstream(ios_base::in) {}
|
| 18 |
+
explicit basic_istringstream(ios_base::openmode which);
|
| 19 |
+
explicit basic_istringstream(
|
| 20 |
+
const basic_string<charT, traits, Allocator>& s,
|
| 21 |
+
ios_base::openmode which = ios_base::in);
|
| 22 |
+
basic_istringstream(ios_base::openmode which, const Allocator& a);
|
| 23 |
+
explicit basic_istringstream(
|
| 24 |
+
basic_string<charT, traits, Allocator>&& s,
|
| 25 |
+
ios_base::openmode which = ios_base::in);
|
| 26 |
+
template<class SAlloc>
|
| 27 |
+
basic_istringstream(
|
| 28 |
+
const basic_string<charT, traits, SAlloc>& s, const Allocator& a)
|
| 29 |
+
: basic_istringstream(s, ios_base::in, a) {}
|
| 30 |
+
template<class SAlloc>
|
| 31 |
+
basic_istringstream(
|
| 32 |
+
const basic_string<charT, traits, SAlloc>& s,
|
| 33 |
+
ios_base::openmode which, const Allocator& a);
|
| 34 |
+
template<class SAlloc>
|
| 35 |
+
explicit basic_istringstream(
|
| 36 |
+
const basic_string<charT, traits, SAlloc>& s,
|
| 37 |
+
ios_base::openmode which = ios_base::in);
|
| 38 |
+
basic_istringstream(const basic_istringstream&) = delete;
|
| 39 |
+
basic_istringstream(basic_istringstream&& rhs);
|
| 40 |
+
|
| 41 |
+
basic_istringstream& operator=(const basic_istringstream&) = delete;
|
| 42 |
+
basic_istringstream& operator=(basic_istringstream&& rhs);
|
| 43 |
+
|
| 44 |
+
// [istringstream.swap], swap
|
| 45 |
+
void swap(basic_istringstream& rhs);
|
| 46 |
+
|
| 47 |
+
// [istringstream.members], members
|
| 48 |
+
basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
|
| 49 |
+
basic_string<charT, traits, Allocator> str() const &;
|
| 50 |
+
template<class SAlloc>
|
| 51 |
+
basic_string<charT,traits,SAlloc> str(const SAlloc& sa) const;
|
| 52 |
+
basic_string<charT, traits, Allocator> str() &&;
|
| 53 |
+
basic_string_view<charT, traits> view() const noexcept;
|
| 54 |
+
|
| 55 |
+
void str(const basic_string<charT, traits, Allocator>& s);
|
| 56 |
+
template<class SAlloc>
|
| 57 |
+
void str(const basic_string<charT, traits, SAlloc>& s);
|
| 58 |
+
void str(basic_string<charT, traits, Allocator>&& s);
|
| 59 |
+
|
| 60 |
+
private:
|
| 61 |
+
basic_stringbuf<charT, traits, Allocator> sb; // exposition only
|
| 62 |
+
};
|
| 63 |
+
}
|
| 64 |
+
```
|
| 65 |
+
|
| 66 |
+
The class `basic_istringstream<charT, traits, Allocator>` supports
|
| 67 |
+
reading objects of class `basic_string<{}charT, traits, Allocator>`. It
|
| 68 |
+
uses a `basic_stringbuf<charT, traits, Allocator>` object to control the
|
| 69 |
+
associated storage. For the sake of exposition, the maintained data is
|
| 70 |
+
presented here as:
|
| 71 |
+
|
| 72 |
+
- `sb`, the `stringbuf` object.
|
| 73 |
+
|