C++ Type Dispatch

Techniques for type dispatch in C++: tag dispatch, if constexpr, std::variant with std::visit, and how to choose the right approach for your use case.

November 10, 2024 · 8 min · Nimrod

How to Resolve Macro Name Collisions

Practical techniques to resolve C/C++ macro name collisions between system headers and user code: undef, parenthesization, and inline function workarounds.

February 25, 2024 · 3 min · Nimrod

A Subtle Bug Before C++17

A deep dive into a subtle C++ performance bug: why over-aligned dynamic memory allocation was undefined before C++17 and how alignas interacts with operator new.

April 21, 2022 · 3 min · Nimrod

Iyengar111 NanoLog Source Code Reading

Deep dive into NanoLog, an extremely fast C++ logging library: how it achieves nanosecond-scale latency with lock-free queues and cache-line alignment.

April 9, 2022 · 11 min · Nimrod

Glog Source Code Reading Notes

Source code analysis of Google’s glog logging library: how it handles log severity, log file rotation, signal handling, and thread safety.

March 12, 2022 · 12 min · Nimrod

How to Return Values Effectively in C++

A guide to returning values effectively in C++: RVO, NRVO, move semantics, and when to use out parameters — with benchmarks and compiler guarantees.

March 1, 2022 · 7 min · Nimrod