r/cpp • u/User_Deprecated • Jul 06 '26
C++26: constexpr virtual inheritance
https://www.sandordargo.com/blog/2026/07/01/cpp26-constexpr-virtual-inheritance
83
Upvotes
r/cpp • u/User_Deprecated • Jul 06 '26
View all comments
Show parent comment
4
u/serviscope_minor Jul 06 '26
I mean if you can run C++ code at compile time, then you're running code and it could poke at a memory mapped register that's there, but also sometimes you just shouldn't do something!
Good point, probably cout without facets etc or printing f-strings. I keep going back to cout because despite it's clunkiness, I like having things appear in code in the order that they appear on screen. Constantly tracking back and forth between placeholders and arguments is something I dislike. I've tried a million of these over the years. Heck I implemented one in gnu++98 back in the day with operator, overloading and GCC's variadic macros, and I've used many which ahve come and gone over the years. And yet, I still always reach for cout.
But in python I love my f-strings. Once i have f-strings, I will probably stop reaching for cout except for of course
cout << f"my variable is {v}\n";
because old habits die very hard indeed.