From 9d4fc0b5cb188392e1505e5fc098b6d7166a7065 Mon Sep 17 00:00:00 2001 From: Thibault Kruse Date: Thu, 11 Aug 2016 19:00:23 +0200 Subject: [PATCH] bad type --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 0dadb30..d81d8f8 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -12284,7 +12284,7 @@ One strategy is to add a `valid()` operation to every resource handle: // handle error or exit } - Ifstream fs("foo"); // not std::ifstream: valid() added + ifstream fs("foo"); // not std::ifstream: valid() added if (!fs.valid()) { // handle error or exit } @@ -12721,7 +12721,7 @@ In such cases, "crashing" is simply leaving error handling to the next level of Most programs cannot handle memory exhaustion gracefully anyway. This is roughly equivalent to - void f(Int n) + void f(int n) { // ... p = new X[n]; // throw if memory is exhausted (by default, terminate)