What is the rationale for non-addressable functions in namespace std?

Viewed 162

[namespace.std] disallows taking the address of, or a reference to, most functions in the std namespace. This is a big pitfall, as it often seems to work to pass a standard-library function as an argument, even though this could stop working, or worse, on a different compiler.

Presumably, this was done to allow implementations to optimize the standard library specially. This restriction makes C++ harder to use.

Can you give explicit examples of how C++ implementations benefit from this restriction on the std namespace?

If these optimizations are so important as to warrant making C++ harder to use, why don't some non-system libraries need the same thing?

0 Answers
Related