From Jason Turner

[ifstream]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpi_164pmp/{from.md → to.md} +22 -32
tmp/tmpi_164pmp/{from.md → to.md} RENAMED
@@ -19,15 +19,15 @@ namespace std {
19
  ios_base::openmode mode = ios_base::in);// wide systems only; see [fstream.syn]
20
  explicit basic_ifstream(const string& s,
21
  ios_base::openmode mode = ios_base::in);
22
  explicit basic_ifstream(const filesystem::path& s,
23
  ios_base::openmode mode = ios_base::in);
24
- basic_ifstream(const basic_ifstream& rhs) = delete;
25
  basic_ifstream(basic_ifstream&& rhs);
26
 
27
  // [ifstream.assign], assign and swap
28
- basic_ifstream& operator=(const basic_ifstream& rhs) = delete;
29
  basic_ifstream& operator=(basic_ifstream&& rhs);
30
  void swap(basic_ifstream& rhs);
31
 
32
  // [ifstream.members], members
33
  basic_filebuf<charT, traits>* rdbuf() const;
@@ -54,62 +54,52 @@ files. It uses a `basic_filebuf<{}charT, traits>` object to control the
54
  associated sequence. For the sake of exposition, the maintained data is
55
  presented here as:
56
 
57
  - `sb`, the `filebuf` object.
58
 
59
- #### `basic_ifstream` constructors <a id="ifstream.cons">[[ifstream.cons]]</a>
60
 
61
  ``` cpp
62
  basic_ifstream();
63
  ```
64
 
65
- *Effects:* Constructs an object of class
66
- `basic_ifstream<charT, traits>`, initializing the base class with
67
- `basic_istream(&sb)` and initializing `sb` with
68
- `basic_filebuf<charT, traits>())` ([[istream.cons]], [[filebuf.cons]]).
69
 
70
  ``` cpp
71
  explicit basic_ifstream(const char* s,
72
  ios_base::openmode mode = ios_base::in);
73
  explicit basic_ifstream(const filesystem::path::value_type* s,
74
  ios_base::openmode mode = ios_base::in); // wide systems only; see [fstream.syn]
75
  ```
76
 
77
- *Effects:* Constructs an object of class `basic_ifstream`, initializing
78
- the base class with `basic_istream(&sb)` and initializing `sb` with
79
- `basic_filebuf<charT, traits>())` ([[istream.cons]], [[filebuf.cons]]),
80
- then calls `rdbuf()->open(s, mode | ios_base::in)`. If that function
81
- returns a null pointer, calls `setstate(failbit)`.
82
 
83
  ``` cpp
84
  explicit basic_ifstream(const string& s,
85
  ios_base::openmode mode = ios_base::in);
86
  explicit basic_ifstream(const filesystem::path& s,
87
  ios_base::openmode mode = ios_base::in);
88
  ```
89
 
90
- *Effects:* The same as `basic_ifstream(s.c_str(), mode)`.
91
 
92
  ``` cpp
93
  basic_ifstream(basic_ifstream&& rhs);
94
  ```
95
 
96
- *Effects:* Move constructs from the rvalue `rhs`. This is accomplished
97
- by move constructing the base class, and the contained `basic_filebuf`.
98
- Next `basic_istream<charT, traits>::set_rdbuf(&sb)` is called to install
99
- the contained `basic_filebuf`.
100
 
101
- #### Assign and swap <a id="ifstream.assign">[[ifstream.assign]]</a>
102
-
103
- ``` cpp
104
- basic_ifstream& operator=(basic_ifstream&& rhs);
105
- ```
106
-
107
- *Effects:* Move assigns the base and members of `*this` from the base
108
- and corresponding members of `rhs`.
109
-
110
- *Returns:* `*this`.
111
 
112
  ``` cpp
113
  void swap(basic_ifstream& rhs);
114
  ```
115
 
@@ -120,19 +110,19 @@ void swap(basic_ifstream& rhs);
120
  template<class charT, class traits>
121
  void swap(basic_ifstream<charT, traits>& x,
122
  basic_ifstream<charT, traits>& y);
123
  ```
124
 
125
- *Effects:* As if by `x.swap(y)`.
126
 
127
  #### Member functions <a id="ifstream.members">[[ifstream.members]]</a>
128
 
129
  ``` cpp
130
  basic_filebuf<charT, traits>* rdbuf() const;
131
  ```
132
 
133
- *Returns:* `const_cast<basic_filebuf<charT, traits>*>(&sb)`.
134
 
135
  ``` cpp
136
  bool is_open() const;
137
  ```
138
 
@@ -144,12 +134,12 @@ void open(const filesystem::path::value_type* s,
144
  ios_base::openmode mode = ios_base::in); // wide systems only; see [fstream.syn]
145
  ```
146
 
147
  *Effects:* Calls `rdbuf()->open(s, mode | ios_base::in)`. If that
148
  function does not return a null pointer calls `clear()`, otherwise calls
149
- `setstate(failbit)` (which may throw `ios_base::failure`)
150
- ([[iostate.flags]]).
151
 
152
  ``` cpp
153
  void open(const string& s, ios_base::openmode mode = ios_base::in);
154
  void open(const filesystem::path& s, ios_base::openmode mode = ios_base::in);
155
  ```
@@ -160,7 +150,7 @@ void open(const filesystem::path& s, ios_base::openmode mode = ios_base::in);
160
  void close();
161
  ```
162
 
163
  *Effects:* Calls `rdbuf()->close()` and, if that function returns a null
164
  pointer, calls `setstate(failbit)` (which may throw
165
- `ios_base::failure`) ([[iostate.flags]]).
166
 
 
19
  ios_base::openmode mode = ios_base::in);// wide systems only; see [fstream.syn]
20
  explicit basic_ifstream(const string& s,
21
  ios_base::openmode mode = ios_base::in);
22
  explicit basic_ifstream(const filesystem::path& s,
23
  ios_base::openmode mode = ios_base::in);
24
+ basic_ifstream(const basic_ifstream&) = delete;
25
  basic_ifstream(basic_ifstream&& rhs);
26
 
27
  // [ifstream.assign], assign and swap
28
+ basic_ifstream& operator=(const basic_ifstream&) = delete;
29
  basic_ifstream& operator=(basic_ifstream&& rhs);
30
  void swap(basic_ifstream& rhs);
31
 
32
  // [ifstream.members], members
33
  basic_filebuf<charT, traits>* rdbuf() const;
 
54
  associated sequence. For the sake of exposition, the maintained data is
55
  presented here as:
56
 
57
  - `sb`, the `filebuf` object.
58
 
59
+ #### Constructors <a id="ifstream.cons">[[ifstream.cons]]</a>
60
 
61
  ``` cpp
62
  basic_ifstream();
63
  ```
64
 
65
+ *Effects:* Initializes the base class with
66
+ `basic_istream<charT, traits>(addressof(sb))` [[istream.cons]] and `sb`
67
+ with `basic_filebuf<charT, traits>()` [[filebuf.cons]].
 
68
 
69
  ``` cpp
70
  explicit basic_ifstream(const char* s,
71
  ios_base::openmode mode = ios_base::in);
72
  explicit basic_ifstream(const filesystem::path::value_type* s,
73
  ios_base::openmode mode = ios_base::in); // wide systems only; see [fstream.syn]
74
  ```
75
 
76
+ *Effects:* Initializes the base class with
77
+ `basic_istream<charT, traits>(addressof(sb))` [[istream.cons]] and `sb`
78
+ with `basic_filebuf<charT, traits>()` [[filebuf.cons]], then calls
79
+ `rdbuf()->open(s, mode | ios_base::in)`. If that function returns a null
80
+ pointer, calls `setstate(failbit)`.
81
 
82
  ``` cpp
83
  explicit basic_ifstream(const string& s,
84
  ios_base::openmode mode = ios_base::in);
85
  explicit basic_ifstream(const filesystem::path& s,
86
  ios_base::openmode mode = ios_base::in);
87
  ```
88
 
89
+ *Effects:* Equivalent to: `basic_ifstream(s.c_str(), mode)`.
90
 
91
  ``` cpp
92
  basic_ifstream(basic_ifstream&& rhs);
93
  ```
94
 
95
+ *Effects:* Move constructs the base class, and the contained
96
+ `basic_filebuf`. Then calls
97
+ `basic_istream<charT, traits>::set_rdbuf(addressof(sb))` to install the
98
+ contained `basic_filebuf`.
99
 
100
+ #### Assignment and swap <a id="ifstream.assign">[[ifstream.assign]]</a>
 
 
 
 
 
 
 
 
 
101
 
102
  ``` cpp
103
  void swap(basic_ifstream& rhs);
104
  ```
105
 
 
110
  template<class charT, class traits>
111
  void swap(basic_ifstream<charT, traits>& x,
112
  basic_ifstream<charT, traits>& y);
113
  ```
114
 
115
+ *Effects:* Equivalent to: `x.swap(y)`.
116
 
117
  #### Member functions <a id="ifstream.members">[[ifstream.members]]</a>
118
 
119
  ``` cpp
120
  basic_filebuf<charT, traits>* rdbuf() const;
121
  ```
122
 
123
+ *Returns:* `const_cast<basic_filebuf<charT, traits>*>(addressof(sb))`.
124
 
125
  ``` cpp
126
  bool is_open() const;
127
  ```
128
 
 
134
  ios_base::openmode mode = ios_base::in); // wide systems only; see [fstream.syn]
135
  ```
136
 
137
  *Effects:* Calls `rdbuf()->open(s, mode | ios_base::in)`. If that
138
  function does not return a null pointer calls `clear()`, otherwise calls
139
+ `setstate(failbit)` (which may throw
140
+ `ios_base::failure`) [[iostate.flags]].
141
 
142
  ``` cpp
143
  void open(const string& s, ios_base::openmode mode = ios_base::in);
144
  void open(const filesystem::path& s, ios_base::openmode mode = ios_base::in);
145
  ```
 
150
  void close();
151
  ```
152
 
153
  *Effects:* Calls `rdbuf()->close()` and, if that function returns a null
154
  pointer, calls `setstate(failbit)` (which may throw
155
+ `ios_base::failure`) [[iostate.flags]].
156