#constexpr
Achievement unlocked:

if consteval {
if constexpr (foo) {
if (bar) {
throw error;
}
}
}
November 8, 2025 at 11:40 AM
If you’ve ever wondered what it’s like to be a c++ coder at 50 - I’ve just been staring at a compiler error for 10 minutes and now just realized I misspelled “constexpr”. #cpp
November 7, 2025 at 3:03 PM
Would refer to it as a conversion more than a cast but yes. Because the constructor is constexpr and it’s being fed with a float literal it even does this conversion at compiletime
November 6, 2025 at 1:36 AM
you can even define a global precision like:

constexpr auto FractBits = 10;
using Fixed = fp32_t<FractBits>;

{ … auto x = Fixed(45.678); … }
November 6, 2025 at 1:25 AM
Introducing the Constexpr Debugger -- Alexander Karaev
Introducing the Constexpr Debugger -- Alexander Karaev : Standard C++
Introducing the Constexpr Debugger -- Alexander Karaev
isocpp.org
November 5, 2025 at 6:20 PM
I'm amazed at #cpp and #VisualStudio where the mix of constexpr and static_assert actually executes non-trivial constexpr functions in the IDE, as I type the code, and directly shows the errors by underlining the static_assert.
🤯

With that, who needs runtime tests? Just compile!
🤩
November 5, 2025 at 6:09 PM
I am very happy that C++26 finally has comptime iteration. Iterating over tuples has been possible for a long time, but was very verbose and full of unnecessary boilerplate.
My head does not wrap around the syntax, however. Why `template for(. . .)` instead of `for constexpr(. . .)`???
November 3, 2025 at 4:53 PM
youtu.be/uiDkAE_kt5c
CCC Simple modules, no imports, ordering.
Simple ref types nullability, val/var, default init/clinit.
Compiletime eval, constexpr, rmw vs atomic vs ordering.
Coffee Compiler Club, 2025_10_31
YouTube video by Cliff Click
youtu.be
October 31, 2025 at 8:49 PM
I was thinking along the same lines, write a constexpr fn in imgui.cpp that looks at the stringified expanded macro content string and returns true if it seems like there's real code in the macro, then static_assert on that

Feels like a lot for a config check, but idk what else would be portable
October 30, 2025 at 4:25 PM
I'd missed the announcement for this. Debugging constexpr for your C++ code! That's pretty nifty. Works in Rider too, for all you Unreal Engine developers
blog.jetbrains.com/clion/2025/0...
Introducing the Constexpr Debugger | The CLion Blog
The new Constexpr Debugger available in the first CLion 2025.3 EAP build allows you to stay in the compiler’s world and see what really happens.
blog.jetbrains.com
October 30, 2025 at 2:24 PM
Well yes but that's just more of the problem with the current model. C++ and Rust very slowly accrete more and more things that are allowed in constexpr/constfn until it converges to let you do everything you could at runtime. In a few decades they'll catch up to lisp.
October 29, 2025 at 3:50 PM
Vec is a function that takes a type X and returns a new container type that holds Xs. Viewed this way <> is just the call syntax for compile time functions, except that C++ and Rust also introduced constexpr/constfn that still use the () syntax so it's just inconsistent.
October 29, 2025 at 3:39 PM
TIL std::hash is not constexpr, oh well.

How a small bug report and "yeah, shouldn't be too hard to fix" ends up in the second refactoring in three days :/
October 29, 2025 at 12:08 PM
C++ is yassified C.
C is yassified assembly.
Assembly is yassified machine code.

yaaas qween constexpr legend std::move the house down noexcept slay queen template mama and I OOP auto&& daddy work concept my wig
October 29, 2025 at 8:03 AM
Hey mom, I'm coding clever things again:

template <class C, class R, class… Args>
R (* GetFn (R (C::*m) (Args…))) (void *, Args…) {

 typedef R (C::* MemFn) (Args…);
 typedef R (* RegFn) (void *, Args…);
 constexpr auto x = sizeof (MemFn) - sizeof (RegFn);
...
October 29, 2025 at 1:18 AM
The idea is to declare it like this
constexpr auto myFoldout = Foldout("title",
Label("label"),
Field(&MyData::MyField)
);
and then at runtime do
foldoutInstance = bind(myFoldout, myDataInstance)
October 28, 2025 at 7:55 PM
When building the GUI for an IMGUI style UI, I basically build up a tree for each frame. So it's completely possible to just insert a branch in this tree and make it work
So I'm having this (possibly bad) idea that I could build a whole branch in a constexpr expression (and I've got that working)
October 28, 2025 at 7:55 PM
MSVC ainda nn tem map constexpr...

Bora Microsoft, tem gente querendo trabalhar aqui
October 28, 2025 at 3:08 PM
I've kept my library C++17 compatible, so I still use a minimal amount of older TMP tricks. The difference now is I use them critically: Only when I have to, only when it's absolutely necessary.

My compile time code is mostly constexpr these days which is quite fast. Thanks!

5/5
October 27, 2025 at 1:37 PM
As for coding for compile time speed?

With my metacompiler implementation, the constexpr functions that act as continuations require the ability to isolate function arguments, which is to say variadic indexing.

4/5
October 27, 2025 at 1:37 PM
It is the inspiration for my 2021 C++Now (online) talk:

Practical TMP: A C++17 Compile Time Register Machine

From there I used the same idea but switched to constexpr functions which in effect allows one to "inject" function code directly into C++ compiler's syntax trees (gcc/clang).

2/5
October 27, 2025 at 1:37 PM
Chat, isso é crime?
October 26, 2025 at 9:53 PM
overheard: “please make this function constexpr so I can commit compile-time crimes”
October 26, 2025 at 5:58 PM
Our next talk from CppNorth 2025 is now on YouTube! ⚙️

Watch Daniel Nikpayuk (@nikpayuk.bsky.social): "A universal data structure for compile time use."

Explore constexpr restrictions & paradigms for designing potent, compile-time data structures.

🔗 youtu.be/UAmyfaXpPiA

#CppNorth #cpp #constexpr
Daniel Nikpayuk - A universal data structure for compile time use
YouTube video by CppNorth
youtu.be
October 25, 2025 at 5:26 PM
found this by accident the other day & was reminded of it by this post: `if constexpr` is 100% ok with having c++20 likelihood attributes applied to it for some reason

godbolt.org/z/zP4WKPeMx
October 19, 2025 at 10:05 AM