4 ms·
Well, for example you may have some functions which accept types and return types, which are not compatible with some input types, and indicate their incompatib
by anonymoushn 1y ago
Well, for example you may have some functions which accept types and return types, which are not compatible with some input types, and indicate their incompatibility by raising an error so that compilation fails. If the program actually does not pass some type to such a function that leads to this sort of error, it would seem like a bug for the compiler to choose to evaluate that function with that argument anyway, in the same way that it would be a bug if I had said "template" throughout this comment. And it is not generally regarded as a deficiency in C++ that if the compiler suddenly chose to instantiate every template with every value or type, some of the resulting instantiations would not compile.
- dwattttt 1y agoTo take an extreme example, what if I asserted the Riemann hypothesis in comptime? It's relying on comptime execution to act as a proof checker. Which is fine for small inputs and uses, but it's not something that would scale well.
- deleted 1y ago[deleted]