Different Types
Implementation of any functionality can vary widely. In the case of CTFE there is a number of different versions that can be implemented. To understand what can be used in hypothetical languages or implementations we will be categorizing them as:
- Constant expansion
- Macros
- Execution
- AST execution
- External execution
Constant expansion
An implementation defined as constant expansion is used primarily for numbers. While it does not form function execution during runtime, this is the basis for majority of the implementations.
All languages used this to some degree. Some have fancy support where by number constants can be in any number of formats. They could even form other types such as strings.