From Jason Turner

[istringstream]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmphvq16x69/{from.md → to.md} +16 -14
tmp/tmphvq16x69/{from.md → to.md} RENAMED
@@ -4,31 +4,32 @@
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
- typedef charT char_type;
10
- typedef typename traits::int_type int_type;
11
- typedef typename traits::pos_type pos_type;
12
- typedef typename traits::off_type off_type;
13
- typedef traits traits_type;
14
- typedef Allocator allocator_type;
15
 
16
- // [istringstream.cons] Constructors:
17
- explicit basic_istringstream(ios_base::openmode which = ios_base::in);
 
18
  explicit basic_istringstream(
19
  const basic_string<charT, traits, Allocator>& str,
20
  ios_base::openmode which = ios_base::in);
21
  basic_istringstream(const basic_istringstream& rhs) = delete;
22
  basic_istringstream(basic_istringstream&& rhs);
23
 
24
- // [istringstream.assign] Assign and swap:
25
  basic_istringstream& operator=(const basic_istringstream& rhs) = delete;
26
  basic_istringstream& operator=(basic_istringstream&& rhs);
27
  void swap(basic_istringstream& rhs);
28
 
29
- // [istringstream.members] Members:
30
  basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
31
 
32
  basic_string<charT, traits, Allocator> str() const;
33
  void str(const basic_string<charT, traits, Allocator>& s);
34
  private:
@@ -75,12 +76,12 @@ explicit basic_istringstream(
75
  basic_istringstream(basic_istringstream&& rhs);
76
  ```
77
 
78
  *Effects:* Move constructs from the rvalue `rhs`. This is accomplished
79
  by move constructing the base class, and the contained
80
- `basic_stringbuf`. Next `basic_istream<charT,traits>::set_rdbuf(&sb)` is
81
- called to install the contained `basic_stringbuf`.
82
 
83
  #### Assign and swap <a id="istringstream.assign">[[istringstream.assign]]</a>
84
 
85
  ``` cpp
86
  basic_istringstream& operator=(basic_istringstream&& rhs);
@@ -102,19 +103,20 @@ void swap(basic_istringstream& rhs);
102
  template <class charT, class traits, class Allocator>
103
  void swap(basic_istringstream<charT, traits, Allocator>& x,
104
  basic_istringstream<charT, traits, Allocator>& y);
105
  ```
106
 
107
- *Effects:* `x.swap(y)`.
108
 
109
  #### Member functions <a id="istringstream.members">[[istringstream.members]]</a>
110
 
111
  ``` cpp
112
  basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
113
  ```
114
 
115
- *Returns:* `const_cast<basic_stringbuf<charT,traits,Allocator>*>(&sb)`.
 
116
 
117
  ``` cpp
118
  basic_string<charT, traits, Allocator> str() const;
119
  ```
120
 
 
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
+ explicit basic_istringstream(
18
+ ios_base::openmode which = ios_base::in);
19
  explicit basic_istringstream(
20
  const basic_string<charT, traits, Allocator>& str,
21
  ios_base::openmode which = ios_base::in);
22
  basic_istringstream(const basic_istringstream& rhs) = delete;
23
  basic_istringstream(basic_istringstream&& rhs);
24
 
25
+ // [istringstream.assign], assign and swap
26
  basic_istringstream& operator=(const basic_istringstream& rhs) = delete;
27
  basic_istringstream& operator=(basic_istringstream&& rhs);
28
  void swap(basic_istringstream& rhs);
29
 
30
+ // [istringstream.members], members
31
  basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
32
 
33
  basic_string<charT, traits, Allocator> str() const;
34
  void str(const basic_string<charT, traits, Allocator>& s);
35
  private:
 
76
  basic_istringstream(basic_istringstream&& rhs);
77
  ```
78
 
79
  *Effects:* Move constructs from the rvalue `rhs`. This is accomplished
80
  by move constructing the base class, and the contained
81
+ `basic_stringbuf`. Next `basic_istream<charT, traits>::set_rdbuf(&sb)`
82
+ is called to install the contained `basic_stringbuf`.
83
 
84
  #### Assign and swap <a id="istringstream.assign">[[istringstream.assign]]</a>
85
 
86
  ``` cpp
87
  basic_istringstream& operator=(basic_istringstream&& rhs);
 
103
  template <class charT, class traits, class Allocator>
104
  void swap(basic_istringstream<charT, traits, Allocator>& x,
105
  basic_istringstream<charT, traits, Allocator>& y);
106
  ```
107
 
108
+ *Effects:* As if by `x.swap(y)`.
109
 
110
  #### Member functions <a id="istringstream.members">[[istringstream.members]]</a>
111
 
112
  ``` cpp
113
  basic_stringbuf<charT, traits, Allocator>* rdbuf() const;
114
  ```
115
 
116
+ *Returns:*
117
+ `const_cast<basic_stringbuf<charT, traits, Allocator>*>(&sb)`.
118
 
119
  ``` cpp
120
  basic_string<charT, traits, Allocator> str() const;
121
  ```
122