C++ Logo

std-proposals

Advanced search

Re: [std-proposals] Function only accepts parameter that will persist

From: Sebastian Wittmeier <wittmeier_at_[hidden]>
Date: Fri, 3 May 2024 14:44:38 +0200
Up till now, it is the decision of the compiler, whether to evaluate those expressions in compile-time or runtime. This was chosen on purpose. "must be a compile-time constant." would contradict this philosophy. Even __builtin_constant_p keeps the compiler's freedom not to detect compile-time constants, if it chooses not to so or if it would take too many resources. If you want to standardize a different behaviour it would take a lot more of a reasoning than just a simple: It would be useful. You would have to understand the reasoning behind the current behaviour and balance the arguments.

Received on 2024-05-03 12:44:41