@@ -21298,6 +21298,38 @@ ISO Standard, but with upper case used for your own types and concepts:
21298
21298
21299
21299
Impossible.
21300
21300
21301
+ ### <a name="Rl-literals"></a>NL.11: Make literals readable
21302
+
21303
+ ##### Reason
21304
+
21305
+ Readability.
21306
+
21307
+ ##### Example
21308
+
21309
+ Use digit separators to avoid long strings of digits
21310
+
21311
+ auto c = 299'792'458; // m/s2
21312
+ auto q2 = 0b0000'1111'0000'0000;
21313
+ auto ss_number = 123'456'7890;
21314
+
21315
+ ##### Example
21316
+
21317
+ Use literal suffixes where clarification is needed
21318
+
21319
+ auto hello = "Hello!"s; // a std::string
21320
+ auto world = "world"; // a C-style string
21321
+ auto interval = 100ms; // using <chrono>
21322
+
21323
+ ##### Note
21324
+
21325
+ Literals should not be sprinkled all over the code as ["magic constants"](#Res-magic),
21326
+ but it is still a good idea to make them readable where they are defined.
21327
+ It is easy to make a typo in a long string of integers.
21328
+
21329
+ ##### Enforcement
21330
+
21331
+ Flag long digit sequences. The trouble is to define "long"; maybe 7.
21332
+
21301
21333
### <a name="Rl-space"></a>NL.15: Use spaces sparingly
21302
21334
21303
21335
##### Reason
@@ -21333,38 +21365,6 @@ This rule was added after many requests for guidance.
21333
21365
21334
21366
We value well-placed whitespace as a significant help for readability. Just don't overdo it.
21335
21367
21336
- ### <a name="Rl-literals"></a>NL.11: Make literals readable
21337
-
21338
- ##### Reason
21339
-
21340
- Readability.
21341
-
21342
- ##### Example
21343
-
21344
- Use digit separators to avoid long strings of digits
21345
-
21346
- auto c = 299'792'458; // m/s2
21347
- auto q2 = 0b0000'1111'0000'0000;
21348
- auto ss_number = 123'456'7890;
21349
-
21350
- ##### Example
21351
-
21352
- Use literal suffixes where clarification is needed
21353
-
21354
- auto hello = "Hello!"s; // a std::string
21355
- auto world = "world"; // a C-style string
21356
- auto interval = 100ms; // using <chrono>
21357
-
21358
- ##### Note
21359
-
21360
- Literals should not be sprinkled all over the code as ["magic constants"](#Res-magic),
21361
- but it is still a good idea to make them readable where they are defined.
21362
- It is easy to make a typo in a long string of integers.
21363
-
21364
- ##### Enforcement
21365
-
21366
- Flag long digit sequences. The trouble is to define "long"; maybe 7.
21367
-
21368
21368
### <a name="Rl-order"></a>NL.16: Use a conventional class member declaration order
21369
21369
21370
21370
##### Reason
0 commit comments