2 ms·
constexpr is also ridiculously simple to implement -- because the existing compilers already do something similar internally for all enumeration constants. (En
by peterfirefly 3y ago
constexpr is also ridiculously simple to implement -- because the existing compilers already do something similar internally for all enumeration constants.
(Enumeration constants are the identifiers defined inside enum xxx {...})
- flohofwoe 3y ago...and most compilers also already silently treat compile time constant expressions like constexpr, an explicit constexpr just throws an error if the expression isn't actually a compile time constant.