From Jason Turner

[ostream.inserters.character]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpxlhs65fs/{from.md → to.md} +15 -16
tmp/tmpxlhs65fs/{from.md → to.md} RENAMED
@@ -1,11 +1,11 @@
1
  ##### Character inserter function templates <a id="ostream.inserters.character">[[ostream.inserters.character]]</a>
2
 
3
  ``` cpp
4
  template<class charT, class traits>
5
  basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out,
6
- charT c};
7
  template<class charT, class traits>
8
  basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out,
9
  char c);
10
  // specialization
11
  template<class traits>
@@ -18,18 +18,17 @@ template<class traits>
18
  template<class traits>
19
  basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>& out,
20
  unsigned char c);
21
  ```
22
 
23
- *Effects:* Behaves like a formatted inserter (as described
24
- in  [[ostream.formatted.reqmts]]) of `out`. After a `sentry` object is
25
- constructed it inserts characters. In case `c` has type `char` and the
26
- character type of the stream is not `char`, then the character to be
27
- inserted is `out.widen(c)`; otherwise the character is `c`. Padding is
28
- determined as described in  [[facet.num.put.virtuals]]. `width(0)` is
29
- called. The insertion character and any required padding are inserted
30
- into `out`.
31
 
32
  *Returns:* `out`.
33
 
34
  ``` cpp
35
  template<class charT, class traits>
@@ -50,13 +49,14 @@ template<class traits>
50
  ```
51
 
52
  *Requires:* `s` shall not be a null pointer.
53
 
54
  *Effects:* Behaves like a formatted inserter (as described
55
- in  [[ostream.formatted.reqmts]]) of `out`. After a `sentry` object is
56
- constructed it inserts `n` characters starting at `s`, where `n` is the
57
- number that would be computed as if by:
 
58
 
59
  - `traits::length(s)` for the overload where the first argument is of
60
  type `basic_ostream<charT, traits>&` and the second is of type
61
  `const charT*`, and also for the overload where the first argument is
62
  of type `basic_ostream<char, traits>&` and the second is of type
@@ -65,12 +65,11 @@ number that would be computed as if by:
65
  argument is of type `basic_ostream<charT, traits>&` and the second is
66
  of type `const char*`,
67
  - `traits::length(reinterpret_cast<const char*>(s))` for the other two
68
  overloads.
69
 
70
- Padding is determined as described in  [[facet.num.put.virtuals]]. The
71
- `n` characters starting at `s` are widened using
72
- `out.widen` ([[basic.ios.members]]). The widened characters and any
73
- required padding are inserted into `out`. Calls `width(0)`.
74
 
75
  *Returns:* `out`.
76
 
 
1
  ##### Character inserter function templates <a id="ostream.inserters.character">[[ostream.inserters.character]]</a>
2
 
3
  ``` cpp
4
  template<class charT, class traits>
5
  basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out,
6
+ charT c);
7
  template<class charT, class traits>
8
  basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out,
9
  char c);
10
  // specialization
11
  template<class traits>
 
18
  template<class traits>
19
  basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>& out,
20
  unsigned char c);
21
  ```
22
 
23
+ *Effects:* Behaves as a formatted output function
24
+ (  [[ostream.formatted.reqmts]]) of `out`. Constructs a character
25
+ sequence `seq`. If `c` has type `char` and the character type of the
26
+ stream is not `char`, then `seq` consists of `out.widen(c)`; otherwise
27
+ `seq` consists of `c`. Determines padding for `seq` as described
28
+ in  [[ostream.formatted.reqmts]]. Inserts `seq` into `out`. Calls
29
+ `os.width(0)`.
 
30
 
31
  *Returns:* `out`.
32
 
33
  ``` cpp
34
  template<class charT, class traits>
 
49
  ```
50
 
51
  *Requires:* `s` shall not be a null pointer.
52
 
53
  *Effects:* Behaves like a formatted inserter (as described
54
+ in  [[ostream.formatted.reqmts]]) of `out`. Creates a character sequence
55
+ `seq` of `n` characters starting at `s`, each widened using
56
+ `out.widen()` ([[basic.ios.members]]), where `n` is the number that
57
+ would be computed as if by:
58
 
59
  - `traits::length(s)` for the overload where the first argument is of
60
  type `basic_ostream<charT, traits>&` and the second is of type
61
  `const charT*`, and also for the overload where the first argument is
62
  of type `basic_ostream<char, traits>&` and the second is of type
 
65
  argument is of type `basic_ostream<charT, traits>&` and the second is
66
  of type `const char*`,
67
  - `traits::length(reinterpret_cast<const char*>(s))` for the other two
68
  overloads.
69
 
70
+ Determines padding for `seq` as described
71
+ in  [[ostream.formatted.reqmts]]. Inserts `seq` into `out`. Calls
72
+ `width(0)`.
 
73
 
74
  *Returns:* `out`.
75