The advantage to catching a reference, besides obvious reasons of not requiring copyability or performing a copy (potentially a slicing one), is that you can modify it and continue processing with throw;
.
If you want to modify the object, yet continue exception processing with throw;
on the non-modified object, then you must make a copy, and one way of doing so is catch by value.
I think it's pretty contrived, though. Catch by const
reference followed by an explicit copy would better express intent.
Also note, throwing a new C++11 nested_exception
will nest the previously thrown exception object, not the object received by value, within the new exception. In such conditions you could conceivably keep your own reference to the received exception, which would go stale unless you received it by reference.