From Jason Turner

[ofstream.cons]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp7peq6iac/{from.md → to.md} +14 -16
tmp/tmp7peq6iac/{from.md → to.md} RENAMED
@@ -1,43 +1,41 @@
1
- #### `basic_ofstream` constructors <a id="ofstream.cons">[[ofstream.cons]]</a>
2
 
3
  ``` cpp
4
  basic_ofstream();
5
  ```
6
 
7
- *Effects:* Constructs an object of class
8
- `basic_ofstream<charT, traits>`, initializing the base class with
9
- `basic_ostream(&sb)` and initializing `sb` with
10
- `basic_filebuf<charT, traits>())` ([[ostream.cons]], [[filebuf.cons]]).
11
 
12
  ``` cpp
13
  explicit basic_ofstream(const char* s,
14
  ios_base::openmode mode = ios_base::out);
15
  explicit basic_ofstream(const filesystem::path::value_type* s,
16
  ios_base::openmode mode = ios_base::out); // wide systems only; see [fstream.syn]
17
  ```
18
 
19
- *Effects:* Constructs an object of class
20
- `basic_ofstream<charT, traits>`, initializing the base class with
21
- `basic_ostream(&sb)` and initializing `sb` with
22
- `basic_filebuf<charT, traits>())` ([[ostream.cons]], [[filebuf.cons]]),
23
- then calls `rdbuf()->open(s, mode | ios_base::out)`. If that function
24
- returns a null pointer, calls `setstate(failbit)`.
25
 
26
  ``` cpp
27
  explicit basic_ofstream(const string& s,
28
  ios_base::openmode mode = ios_base::out);
29
  explicit basic_ofstream(const filesystem::path& s,
30
  ios_base::openmode mode = ios_base::out);
31
  ```
32
 
33
- *Effects:* The same as `basic_ofstream(s.c_str(), mode)`.
34
 
35
  ``` cpp
36
  basic_ofstream(basic_ofstream&& rhs);
37
  ```
38
 
39
- *Effects:* Move constructs from the rvalue `rhs`. This is accomplished
40
- by move constructing the base class, and the contained `basic_filebuf`.
41
- Next `basic_ostream<charT, traits>::set_rdbuf(&sb)` is called to install
42
- the contained `basic_filebuf`.
43
 
 
1
+ #### Constructors <a id="ofstream.cons">[[ofstream.cons]]</a>
2
 
3
  ``` cpp
4
  basic_ofstream();
5
  ```
6
 
7
+ *Effects:* Initializes the base class with
8
+ `basic_ostream<charT, traits>(addressof(sb))` [[ostream.cons]] and `sb`
9
+ with `basic_filebuf<charT, traits>()` [[filebuf.cons]].
 
10
 
11
  ``` cpp
12
  explicit basic_ofstream(const char* s,
13
  ios_base::openmode mode = ios_base::out);
14
  explicit basic_ofstream(const filesystem::path::value_type* s,
15
  ios_base::openmode mode = ios_base::out); // wide systems only; see [fstream.syn]
16
  ```
17
 
18
+ *Effects:* Initializes the base class with
19
+ `basic_ostream<charT, traits>(addressof(sb))` [[ostream.cons]] and `sb`
20
+ with `basic_filebuf<charT, traits>()` [[filebuf.cons]], then calls
21
+ `rdbuf()->open(s, mode | ios_base::out)`. If that function returns a
22
+ null pointer, calls `setstate(failbit)`.
 
23
 
24
  ``` cpp
25
  explicit basic_ofstream(const string& s,
26
  ios_base::openmode mode = ios_base::out);
27
  explicit basic_ofstream(const filesystem::path& s,
28
  ios_base::openmode mode = ios_base::out);
29
  ```
30
 
31
+ *Effects:* Equivalent to: `basic_ofstream(s.c_str(), mode)`.
32
 
33
  ``` cpp
34
  basic_ofstream(basic_ofstream&& rhs);
35
  ```
36
 
37
+ *Effects:* Move constructs the base class, and the contained
38
+ `basic_filebuf`. Then calls
39
+ `basic_ostream<charT, traits>::set_rdbuf(addressof(sb))` to install the
40
+ contained `basic_filebuf`.
41