This is just a simple example to illustrate the mechanics of the
problem. The actual system is far more complex. For the sake of
argument suppose that f passes the Handle to a different thread
context that destroys the Handle during one of three distinct
timeframes depending on the runtime environment. Either (1) before
the constructor returns; (2) after the constructor returns and before
the assigned handle is destroyed; or (3) after the assigned handle is
destroyed. The problem occurs in case 1.
-Andrew.
That doesn’t make it any less flawed; it just demonstrates that it’s
flawed in a complex manner.
From comp.lang.c++.moderated: