const_cast: A Necessary Evil
Summary
The article explains why const_cast is sometimes necessary in C++, specifically for moving objects out of a std::priority_queue, and how to do it safely.
View Cached Full Text
Cached at: 07/29/26, 05:57 PM
Similar Articles
C Constructs That Still Don’t Work in C++ — and a Few That Changed
A blog post updating the classic survey of C constructs that don't work in C++, covering changes in C++20 and C23 standards that affect compatibility.
Building a Fast Lock-Free Queue in Modern C++ from Scratch
A guide to implementing a fast lock-free queue in modern C++, covering techniques for concurrent data structures without locks.
The C++ Standard Library Has Been Walking Itself Back for Fifteen Years, and the Receipts Are Public
A detailed catalogue of C++ standard library features that have been formally deprecated, informally discouraged, or are effectively broken but cannot be fixed due to ABI constraints, spanning from C++11 to C++26. The article argues a consistent pattern of the C++ committee shipping replacements for its own features, including a benchmark showing 58x P99 latency difference between Rust and C++ standard library containers.
Interconverting std::function with copyable_function
Technical analysis of the interconversion between std::function and std::copyable_function in C++26, discussing implementation approaches and performance trade-offs, with specific note that libstdc++ currently uses a less optimal approach.
The beauty and simplicity of the good old C-style void* in C++
The article discusses the pros and cons of using C-style void* pointers versus uint8_t* and std::span for passing memory blobs in C++, arguing for the simplicity and readability of void*.