diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index f02b617..de51294 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -998,7 +998,8 @@ This is low-level, verbose, and error-prone. For example, we "forgot" to test for memory exhaustion. Instead, we could use `vector`: - vector v(100); + vector v; + v.reserve(100); // ... for (int x; cin >> x; ) { // ... check that x is valid ...