I did @CompileExplore's monthly accounts, and for the first time in ages we only broke even. Usually we run at a small surplus & we have a year contingency saved up. If you want to support us:
* Buy stuff: shop.compiler-explorer.com/
* Patron/GH: "Other" menu on CE
Please repost. thx
Embedded C++ just got safer & faster!
Join Safe & Efficient C++ for Embedded Environments with @Andreas__Fertig to master modern C++ for memory-constrained systems. Type-safe, robust, and efficient coding awaits.
🗓 12 May | 🖥 Online
🔗cpponline.uk/workshop/safe-a…#cpp#embedded
C++ Insights - Episode 72: Why you should never call a virtual member function in a constructor
In this episode, you'll learn by example why you should never call a virtual member function from a constructor.
piped.video/_ZvNJciCXeE#cppinsights#cpp#cpp11
You might have seen that, I'm producing the C++ Insights YouTube channel piped.video/@andreas_fertig. There, I aim to explain various C++ elements, using cppinsights.io. This is where you come in. What is it that you want me to dive in for you?
#cppinsights#youtube#cpp
Embedded C++ just got safer & faster!
Join Safe & Efficient C++ for Embedded Environments with @Andreas__Fertig to master modern C++ for memory-constrained systems. Type-safe, robust, and efficient coding awaits.
🗓 12 May | 🖥 Online
🔗cpponline.uk/workshop/safe-a…#cpp#cplusplus
Have you ever wondered how to use templates when programming C++? Stop guessing and get your copy of tips and tricks to help you write clean code.
Paper: amzn.to/3OnLAIx
E-book: fertig.to/btmpl#cpp14#book#cplusplus
Fellow nerds! 🤓 Want to help me play test my new Programming Puzzles Game website? programmingpuzzles.fun It's the companion site to my Programming Puzzles for Everyone book.
Have fun and report any issues.
C++ Insights - Episode 71: C++23: multidimensional operator[]
In this episode, you'll learn about the change to the operator[] in C++23.
piped.video/_wIj799nLOc#cppinsights#cpp#cpp23
You might have seen that, I'm producing the C++ Insights YouTube channel piped.video/@andreas_fertig. There, I aim to explain various C++ elements, using cppinsights.io. This is where you come in. What is it that you want me to dive in for you?
#cppinsights#youtube#cpp
C++: Understanding static vs. global linkage
Notice the static keyword in the image? The compiler uses it to make smarter decisions.
After parsing, the optimization passes kick in:
1️⃣ Constant Folding
Inputs are constants, so the result (10) is calculated at compile time.
2️⃣ Inlining
The function calls in main are replaced with the raw result 10.
3️⃣ Dead Code Elimination
Look at the top-right pane (-O3):
- The static Foo is deleted (unused & internal).
- But the global foo is kept!
⚠️ Why? Default linkage is external. The compiler preserves foo for potential linking by other files.
Can we fix this? Yes, with the Link Time Optimization (-flto). The linker examines all modules, confirms no one calls foo, and finally removes the dead code.