mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
Fix P.5 first example
The shift instruction in the example should be <<= instead of >>=
This commit is contained in:
parent
2ce60168eb
commit
4757800cfd
|
@ -542,7 +542,7 @@ For example:
|
|||
static_assert(sizeof(Int)>=4); // do: compile-time check
|
||||
|
||||
int bits = 0; // don't: avoidable code
|
||||
for (Int i = 1; i; i>>=1)
|
||||
for (Int i = 1; i; i<<=1)
|
||||
++bits;
|
||||
if (bits<32)
|
||||
cerr << "Int too small\n";
|
||||
|
|
Loading…
Reference in New Issue
Block a user