From Jason Turner

[ostream.inserters.character]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp0w5s_v4j/{from.md → to.md} +17 -26
tmp/tmp0w5s_v4j/{from.md → to.md} RENAMED
@@ -1,50 +1,41 @@
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>
12
- basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>& out,
13
- char c);
14
  // signed and unsigned
15
  template<class traits>
16
- basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>& out,
17
- signed char c);
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>
35
- basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out,
36
- const charT* s);
37
  template<class charT, class traits>
38
- basic_ostream<charT,traits>& operator<<(basic_ostream<charT,traits>& out,
39
- const char* s);
40
  template<class traits>
41
- basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>& out,
42
- const char* s);
43
  template<class traits>
44
- basic_ostream<char,traits>& operator<<(basic_ostream<char,traits>& out,
45
- const signed char* s);
46
  template<class traits>
47
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out,
48
  const unsigned char* s);
49
  ```
50
 
@@ -59,11 +50,11 @@ would be computed as if by:
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
63
  `const char*`,
64
- - `std::char_traits<char>::length(s)` for the overload where the first
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
 
 
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, charT c);
 
6
  template<class charT, class traits>
7
+ basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, char c);
 
8
  // specialization
9
  template<class traits>
10
+ basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, char c);
 
11
  // signed and unsigned
12
  template<class traits>
13
+ basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, signed char c);
 
14
  template<class traits>
15
+ basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, unsigned char c);
 
16
  ```
17
 
18
+ *Effects:* Behaves as a formatted output
19
+ function ([[ostream.formatted.reqmts]]) of `out`. Constructs a
20
+ character sequence `seq`. If `c` has type `char` and the character type
21
+ of the stream is not `char`, then `seq` consists of `out.widen(c)`;
22
+ otherwise `seq` consists of `c`. Determines padding for `seq` as
23
+ described in  [[ostream.formatted.reqmts]]. Inserts `seq` into `out`.
24
+ Calls `os.width(0)`.
25
 
26
  *Returns:* `out`.
27
 
28
  ``` cpp
29
  template<class charT, class traits>
30
+ basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, const charT* s);
 
31
  template<class charT, class traits>
32
+ basic_ostream<charT, traits>& operator<<(basic_ostream<charT, traits>& out, const char* s);
 
33
  template<class traits>
34
+ basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, const char* s);
 
35
  template<class traits>
36
+ basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out, const signed char* s);
 
37
  template<class traits>
38
  basic_ostream<char, traits>& operator<<(basic_ostream<char, traits>& out,
39
  const unsigned char* s);
40
  ```
41
 
 
50
  - `traits::length(s)` for the overload where the first argument is of
51
  type `basic_ostream<charT, traits>&` and the second is of type
52
  `const charT*`, and also for the overload where the first argument is
53
  of type `basic_ostream<char, traits>&` and the second is of type
54
  `const char*`,
55
+ - `char_traits<char>::length(s)` for the overload where the first
56
  argument is of type `basic_ostream<charT, traits>&` and the second is
57
  of type `const char*`,
58
  - `traits::length(reinterpret_cast<const char*>(s))` for the other two
59
  overloads.
60