Why can function pointers be `constexpr`?
问题 How does the compiler know where in memory the square root will be before the program is executed? I thought the address would be different everytime the program is executed, but this works: constexpr double(*fp)(double) = &sqrt; cout << fp(5.0); Is it because the address is relative to another address in memory? I don't think so because the value of fp is large: 0x720E1B94. 回答1: How does the compiler know where in memory the square root will be before the program is executed? The tool chain