I have a silly question. I read this article about std::exception http://www.cplusplus.com/doc/tutorial/exceptions/
On catch (exception& e)
, it says:
No the &
has absolutely no bearing on the polymorphic nature of exception handlers. Their wording is very poor, it does seem to indicate that the &
is somehow responsible. This is not the case. You are correct, &
just passes by reference which is a tad more efficient.
Also as a general rule, you should really try to avoid cplusplus.com.
Updated link: What's wrong with cplusplus.com