Date: Mon, 25 Aug 2025 08:54:10 -0700
> That is not how I or many people view things. We know most of the time compiler does very good job, but sometimes it fails.
That was sarcasm. It you want to get people's attention, just say
something wrong.
> This is not true. constexpr matters. Same for const. For example this code without constexpr will not compile.
I am not suggesting the standard somehow defined constexpr to do
nothing at all. What I am saying is there is a distinction between
"it can be evaluated at compile time" and "the code generator will
more thoroughly evaluate it at compile time than any other code if it
doesn't have to." Can you show me an example of constexpr resulting in
better code generation at runtime (and not compile time?)
Ok, but I have been writing C++ for 20 years and I still don't have
any idea what people are doing running all this code C++ at compile
time. I know of examples from numerical computing that are
compelling. My only use case failed horribly and silently. Yeah, sure
constexpr is better than template meta programming, but that wasn't a
problem we had all day long.
That was sarcasm. It you want to get people's attention, just say
something wrong.
> This is not true. constexpr matters. Same for const. For example this code without constexpr will not compile.
I am not suggesting the standard somehow defined constexpr to do
nothing at all. What I am saying is there is a distinction between
"it can be evaluated at compile time" and "the code generator will
more thoroughly evaluate it at compile time than any other code if it
doesn't have to." Can you show me an example of constexpr resulting in
better code generation at runtime (and not compile time?)
Ok, but I have been writing C++ for 20 years and I still don't have
any idea what people are doing running all this code C++ at compile
time. I know of examples from numerical computing that are
compelling. My only use case failed horribly and silently. Yeah, sure
constexpr is better than template meta programming, but that wasn't a
problem we had all day long.
Received on 2025-08-25 15:54:23