From 60706af58d29d11d5856f2d4a0a7cb3983a24843 Mon Sep 17 00:00:00 2001 From: Titus Winters Date: Tue, 15 Dec 2015 11:30:04 -0500 Subject: [PATCH 1/2] Don't mix future runtime customization constexpr. As discussed in https://github.com/isocpp/CppCoreGuidelines/issues/420 --- CppCoreGuidelines.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index ff31d95..48d1636 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -2079,6 +2079,13 @@ This is usually a very good thing. Don't try to make all functions `constexpr`. Most computation is best done at run time. +##### Note + +Any API that may eventually become configurable or customizable at runtime +should not be made `constexpr`. Such customization could not be evaluated by the +compiler, and any `constexpr` functions that depend upon that API will have to +be refactored or drop `constexpr`. + ##### Enforcement Impossible and unnecessary. From 3918d16274a7af76a5398e30ebc1af4365382fd5 Mon Sep 17 00:00:00 2001 From: Titus Winters Date: Tue, 15 Dec 2015 12:08:22 -0500 Subject: [PATCH 2/2] Revise according to GDRs suggestion in PR 463. --- CppCoreGuidelines.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CppCoreGuidelines.md b/CppCoreGuidelines.md index 48d1636..98d709a 100644 --- a/CppCoreGuidelines.md +++ b/CppCoreGuidelines.md @@ -2081,10 +2081,10 @@ Don't try to make all functions `constexpr`. Most computation is best done at ru ##### Note -Any API that may eventually become configurable or customizable at runtime -should not be made `constexpr`. Such customization could not be evaluated by the -compiler, and any `constexpr` functions that depend upon that API will have to -be refactored or drop `constexpr`. +Any API that may eventually depend on high-level runtime configuration or +business logic should not be made `constexpr`. Such customization can not be +evaluated by the compiler, and any `constexpr` functions that depend upon that +API will have to be refactored or drop `constexpr`. ##### Enforcement