From Jason Turner

[basic.string.literals]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp2f_j7v7p/{from.md → to.md} +30 -0
tmp/tmp2f_j7v7p/{from.md → to.md} RENAMED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ## Suffix for `basic_string` literals <a id="basic.string.literals">[[basic.string.literals]]</a>
2
+
3
+ ``` cpp
4
+ string operator "" s(const char* str, size_t len);
5
+ ```
6
+
7
+ *Returns:* `string{str,len}`
8
+
9
+ ``` cpp
10
+ u16string operator "" s(const char16_t* str, size_t len);
11
+ ```
12
+
13
+ *Returns:* `u16string{str,len}`
14
+
15
+ ``` cpp
16
+ u32string operator "" s(const char32_t* str, size_t len);
17
+ ```
18
+
19
+ *Returns:* `u32string{str,len}`
20
+
21
+ ``` cpp
22
+ wstring operator "" s(const wchar_t* str, size_t len);
23
+ ```
24
+
25
+ *Returns:* `wstring{str,len}`
26
+
27
+ The same suffix `s` is used for `chrono::duration` literals denoting
28
+ seconds but there is no conflict, since duration suffixes apply to
29
+ numbers and string literal suffixes apply to character array literals.
30
+