Argument-Dependent Lookup and the Hidden Friend Idiom -- Rainer Grimm

You've got to know where to find them, know how to bind them, know when to ask for help, from a hidden friend...

Argument-Dependent Lookup and the Hidden Friend Idiom

by Rainer Grimm

From the article:

Have you ever wondered why the following program works?

#include <iostream>

int main() {
    std::cout << "Hello world";
}

Why should the program not work? The overloaded output operator operator<< is defined in the std namespace. The question is, therefore: How is the appropriate overloaded output operator for std::string found? You may already assume it...

Add a Comment

Comments are closed.

Comments (0)

There are currently no comments on this entry.