From e4e22f9e487a5f47308153014e59a483ab342171 Mon Sep 17 00:00:00 2001 From: ven Date: Sun, 20 Sep 2015 01:38:53 +0200 Subject: [PATCH] =?UTF-8?q?Use=20a=20variable=20in=20the=20erroring=20cons?= =?UTF-8?q?texpr=20example=20=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I don't see why it'd fail otherwise, so I assume the "2" was a typo Also add a missing "f" to "side effect" --- CppCoreGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 4d68f67..93945d7 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -1793,10 +1793,10 @@ it just guarantees that the function can be evaluated at compile time for consta int m1 = min(-1,2); // probably compile-time evaluation constexpr int m2 = min(-1,2); // compile-time evaluation int m3 = min(-1,v); // run-time evaluation - constexpr int m4 = min(-1,2); // error: connot evaluate at compile-time + constexpr int m4 = min(-1,v); // error: connot evaluate at compile-time } -**Note**: `constexpr` functions are pure: they can have no sideefects. +**Note**: `constexpr` functions are pure: they can have no side effects. int dcount = 0; constexpr int double(int v)