mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 20:54:41 +03:00
@@ -542,7 +542,7 @@ For example:
|
|||||||
static_assert(sizeof(Int)>=4); // do: compile-time check
|
static_assert(sizeof(Int)>=4); // do: compile-time check
|
||||||
|
|
||||||
int bits = 0; // don't: avoidable code
|
int bits = 0; // don't: avoidable code
|
||||||
for (Int i = 1; i; i>>=1)
|
for (Int i = 1; i; i<<=1)
|
||||||
++bits;
|
++bits;
|
||||||
if (bits<32)
|
if (bits<32)
|
||||||
cerr << "Int too small\n";
|
cerr << "Int too small\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user