mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2024-03-22 13:30:58 +08:00
The vector was missing template arguments. Fixed
Thank you for the feedback in #402. char replaced with uint8_t.
This commit is contained in:
parent
6634ea7d79
commit
282a11de26
|
@ -9120,7 +9120,7 @@ Simple code can be very fast. Optimizers sometimes do marvels with simple code
|
||||||
|
|
||||||
// clear expression of intent, fast execution
|
// clear expression of intent, fast execution
|
||||||
|
|
||||||
vector v(100000);
|
vector<uint8_t> v(100000);
|
||||||
|
|
||||||
for(auto& c : v)
|
for(auto& c : v)
|
||||||
c = ~c;
|
c = ~c;
|
||||||
|
@ -9129,7 +9129,7 @@ Simple code can be very fast. Optimizers sometimes do marvels with simple code
|
||||||
|
|
||||||
// intended to be faster, but is actually slower
|
// intended to be faster, but is actually slower
|
||||||
|
|
||||||
vector v(100000);
|
vector<uint8_t> v(100000);
|
||||||
|
|
||||||
for(size_t i=0; i<v.size(); i+=sizeof(uint64_t))
|
for(size_t i=0; i<v.size(); i+=sizeof(uint64_t))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue
Block a user