mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
avoid keyword name
This commit is contained in:
parent
9d4fc0b5cb
commit
b14fe453a4
|
@ -7449,7 +7449,7 @@ If you can't name an enumeration, the values are not related
|
||||||
|
|
||||||
##### Example, bad
|
##### Example, bad
|
||||||
|
|
||||||
enum { red = 0xFF0000, scale = 4, signed = 1 };
|
enum { red = 0xFF0000, scale = 4, is_signed = 1 };
|
||||||
|
|
||||||
Such code is not uncommon in code written before there were convenient alternative ways of specifying integer constants.
|
Such code is not uncommon in code written before there were convenient alternative ways of specifying integer constants.
|
||||||
|
|
||||||
|
@ -7459,7 +7459,7 @@ Use `constexpr` values instead. For example:
|
||||||
|
|
||||||
constexpr int red = 0x,FF0000;
|
constexpr int red = 0x,FF0000;
|
||||||
constexpr short scale = 4;
|
constexpr short scale = 4;
|
||||||
constexpr bool signed = true;
|
constexpr bool is_signed = true;
|
||||||
|
|
||||||
##### Enforcement
|
##### Enforcement
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user