Compile-time function execution

In computing, compile-time function execution (or compile time function evaluation, or general constant expressions) is the ability of a compiler, that would normally compile a function to machine code and execute it at run time, to execute the function at compile time. This is possible if the arguments to the function are known at compile time, and the function does not make any reference to or attempt to modify any global state (i.e. it is a pure function).

Comment
enIn computing, compile-time function execution (or compile time function evaluation, or general constant expressions) is the ability of a compiler, that would normally compile a function to machine code and execute it at run time, to execute the function at compile time. This is possible if the arguments to the function are known at compile time, and the function does not make any reference to or attempt to modify any global state (i.e. it is a pure function).
Has abstract
enIn computing, compile-time function execution (or compile time function evaluation, or general constant expressions) is the ability of a compiler, that would normally compile a function to machine code and execute it at run time, to execute the function at compile time. This is possible if the arguments to the function are known at compile time, and the function does not make any reference to or attempt to modify any global state (i.e. it is a pure function). If the value of only some of the arguments are known, the compiler may still be able to perform some level of compile-time function execution (partial evaluation), possibly producing more optimized code than if no arguments were known.
Is primary topic of
Compile-time function execution
Label
enCompile-time function execution
Link from a Wikipage to an external page
rosettacode.org/wiki/Compile-time_calculation
Link from a Wikipage to another Wikipage
C++
C++11
C++14
C++20
Category:Articles with example D code
Category:Compiler construction
Category:Compiler optimizations
Compiler
Compile time
Computing
D programming language
Execution (computing)
Machine code
Macro (computer science)
Partial evaluation
Pure function
Run time (program lifecycle phase)
Subroutine
Template metaprogramming
SameAs
4hzKu
Q5156374
اجرای تابع کامپایل زمان
컴파일 타임 함수 실행
Subject
Category:Articles with example D code
Category:Compiler construction
Category:Compiler optimizations
WasDerivedFrom
Compile-time function execution?oldid=1118855397&ns=0
WikiPageLength
8296
Wikipage page ID
10585201
Wikipage revision ID
1118855397
WikiPageUsesTemplate
Template:Compiler optimizations
Template:Short description