Doesen't auto_ptr<int> f() throw()
mean that f() does not throw at all?
Yes.
When you throw an exception, you're expected to catch it, otherwise your program terminates prematurely. In order to catch an exception, you need to try before you can catch it. For example:
Once an exception is thrown within a method, the methods stops; meaning that remaining statements within the method are never executed. This is the same for a try block. When an exception is thrown within a try block, the remaining statements are never executed, and the control is passed to the catch block that handles the thrown exception.
Doesen't
auto_ptr<int> f() throw()
mean that f() does not throw at all?
This is only a hint for the programmer, and *absolutely nothing is guaranteed by the compiler*. There are some minor optimizations that the Visual C++ compiler makes for non-throwing functions with the empty throw() clause but they hardly mean anything.
I reiterate: do not depend on these throws declarations, you are not guaranteed anything by the compiler and it is only a hint for someone reading the code.
(I barely ever use them, they're mostly pointless)