mirror of
https://github.com/isocpp/CppCoreGuidelines.git
synced 2025-12-17 20:54:41 +03:00
Don't mix future runtime customization constexpr.
As discussed in https://github.com/isocpp/CppCoreGuidelines/issues/420
This commit is contained in:
@@ -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.
|
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
|
##### Enforcement
|
||||||
|
|
||||||
Impossible and unnecessary.
|
Impossible and unnecessary.
|
||||||
|
|||||||
Reference in New Issue
Block a user