The Old New Thing
Practical development throughout the evolution of Windows.
Latest posts
How can I know when a window has processed a message that I posted to it?
Best would be to have it tell you.
In C++, how can I make a default parameter be the this pointer of the caller?, revisited
Expanding on the previous pattern.
How can I detect which menu my item was invoked from?
Just give them all different IDs. But this might itself by an XY problem.
How do I determine whether Explorer is showing or hiding file extensions?
You can ask, but maybe you're asking the wrong question.
A wrinkle in how Windows 95 setup bootstrapped its initial GUI step
Getting access to the common controls that don't exist until Windows 95.
The operations for reading and writing single elements for C++ standard library maps
Breaking down the options.
How do I put a non-copyable, non-movable, non-constructible object into a std::optional
?
Taking advantage of the conversion operator.
Solving the puzzle of trying to put an object into a std::optional
How do I set a value? Let me count the ways.
The puzzle of trying to put an object into a std::optional
The C++ standard library template type has one of two states. It could be empty (not contain anything), or it could contain a . Suppose you start with an empty . How do you put a into it? One of my colleagues tried to do it in what seemed to be the most natural way: Use the assignment operator. Unfortunately, the assignment failed to compile: I asked for the rest of the error message, because the details will explain what the compiler tried to do (and why it couldn't). It's long, but we'll walk through it. The compiler is showing its work. It's showing you all the possible overloaded assignment opera...