问题
Starting in C++14, the assert macro can be used in functions even when they are defined as constexpr. I know this has to do with the fact that it evaluates to "true", but I'm having trouble figuring out what the actual code looks like.
Specifically, how do you build a macro that prints something when run in a constexpr function that is being evaluated at run time, but shuts this non-constexpr behavior off when in a constexpr function that is being evaluated at compile time.
来源:https://stackoverflow.com/questions/47725266/how-to-build-a-custom-macro-that-behaves-differently-when-used-as-constexpr-lik