A few weeks ago, I was shown by a dear friend a snippet of C++ (I’ll once again take the opportunity to emphasize friend—i.e., not an enemy) involving the use of operator<<, the stream insertion operator, from the Wikipedia page on argument dependent lookup. The snippet looked something like this:

operator<<(std::cout, "Hi there"); // (1)
std::cout.operator<<("Hi there"); // (2)

The question is, “what’s the output of this program?” In a just world, either this would fail to compile (due to one of (1) or (2) not existing), or it would produce the following output:

Hi there
Hi there

The true answer is, of course, more criminal and dangerous than one would hope of a just world. Let’s see it:

Well, wouldn’t you like to know? Well, if you insist, the rest of this post found its way into Volume 0, Issue 1 of unpressed). Better go take a look.