C++ Coding Standards: Throw by Value, Catch by Reference
Catching and Throwing in C++ can be tricky, but this chapter will help you to know when and how to use these functions effectively, as well as when you shouldn't be using them.
This chapter is from the book
Summary
Learn to catch properly: Throw exceptions by value (not pointer) and catch them by reference (usually to const ). This is the combination that meshes best with exception semantics. When rethrowing the same exception, prefer just throw; to throw e; .
Page 1 of 4
Next >