From Jason Turner

[charconv.syn]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpumrzmu8h/{from.md → to.md} +71 -0
tmp/tmpumrzmu8h/{from.md → to.md} RENAMED
@@ -0,0 +1,71 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Header `<charconv>` synopsis <a id="charconv.syn">[[charconv.syn]]</a>
2
+
3
+ ``` cpp
4
+ %
5
+ %
6
+ {chars_format{chars_format{chars_format{chars_formatnamespace std {
7
+ // floating-point format for primitive numerical conversion
8
+ enum class chars_format {
9
+ scientific = unspecified,
10
+ fixed = unspecified,
11
+ hex = unspecified,
12
+ general = fixed | scientific
13
+ };
14
+ %
15
+ %
16
+ {to_chars_result{to_chars_result}
17
+
18
+ // [charconv.to.chars], primitive numerical output conversion
19
+ struct to_chars_result {
20
+ char* ptr;
21
+ errc ec;
22
+ friend bool operator==(const to_chars_result&, const to_chars_result&) = default;
23
+ };
24
+
25
+ to_chars_result to_chars(char* first, char* last, see below value, int base = 10);
26
+ to_chars_result to_chars(char* first, char* last, bool value, int base = 10) = delete;
27
+
28
+ to_chars_result to_chars(char* first, char* last, float value);
29
+ to_chars_result to_chars(char* first, char* last, double value);
30
+ to_chars_result to_chars(char* first, char* last, long double value);
31
+
32
+ to_chars_result to_chars(char* first, char* last, float value, chars_format fmt);
33
+ to_chars_result to_chars(char* first, char* last, double value, chars_format fmt);
34
+ to_chars_result to_chars(char* first, char* last, long double value, chars_format fmt);
35
+
36
+ to_chars_result to_chars(char* first, char* last, float value,
37
+ chars_format fmt, int precision);
38
+ to_chars_result to_chars(char* first, char* last, double value,
39
+ chars_format fmt, int precision);
40
+ to_chars_result to_chars(char* first, char* last, long double value,
41
+ chars_format fmt, int precision);
42
+ %
43
+ %
44
+ {from_chars_result{from_chars_result}
45
+
46
+ // [charconv.from.chars], primitive numerical input conversion
47
+ struct from_chars_result {
48
+ const char* ptr;
49
+ errc ec;
50
+ friend bool operator==(const from_chars_result&, const from_chars_result&) = default;
51
+ };
52
+
53
+ from_chars_result from_chars(const char* first, const char* last,
54
+ see below& value, int base = 10);
55
+
56
+ from_chars_result from_chars(const char* first, const char* last, float& value,
57
+ chars_format fmt = chars_format::general);
58
+ from_chars_result from_chars(const char* first, const char* last, double& value,
59
+ chars_format fmt = chars_format::general);
60
+ from_chars_result from_chars(const char* first, const char* last, long double& value,
61
+ chars_format fmt = chars_format::general);
62
+ }
63
+ ```
64
+
65
+ The type `chars_format` is a bitmask type [[bitmask.types]] with
66
+ elements `scientific`, `fixed`, and `hex`.
67
+
68
+ The types `to_chars_result` and `from_chars_result` have the data
69
+ members and special members specified above. They have no base classes
70
+ or members other than those specified.
71
+