C++26 adds two new vocabulary types in <memory>, introduced by P3019R14 (Coe, Peacock, Parent). From the abstract: The class template indirect confers value-like semantics on a dynamically-allocated object. An indirect may hold an object of a class T. Copying the indirect will copy the object T. When an indirect<T> is accessed through a const access path, constness will propagat...
If you’ve ever needed to ship a binary file — a certificate, a small image, a default configuration — inside a C++ program, you know the ritual. You find or write a tool that converts the file into a C array, you wire it into your build system, and you pray that nobody forgets to re-run the conversion after updating the original file. C++26 ends this with #embed (P1967R14 by JeanHeyd Meneide)....
Five years ago I published Daily C++ Interview — a collection of questions and answers that grew out of an email course I ran for C++ developers preparing for interviews. It did better than I expected. Over a thousand copies sold and plenty of kind emails from readers who found it genuinely helpful while preparing for their next role. Over time, the feedback made one thing clear: the book deser...
Nowadays, safety is in the focus of C++. Whether it’s at committee meetings, conference talks, or hallway discussions, the topic keeps coming up. C++26 made some big steps forward in this area, and one recurring theme is the reduction of cases leading to undefined behaviour. With the words of one of the presented proposals, “undefined behaviour has all but unbounded potential for bad program b...
After I finished my Time in C++ series, a reader asked a seemingly simple question: “What is the portable way to extract the year, month, day, hour, minute, and second from a file’s modification time? I tried, and I couldn’t get it to work reliably on macOS and Windows.” Fair question. You call std::filesystem::last_write_time(), you get back a time point, and you want the calendar compon...