title: catch exception by pointer in C++
body: <p>I found that there are three ways to catch an exception, what are the differences?</p>
  
  <p>1) catch by value;</p>
  
  <p>2) catch by reference;</p>
  
  <p>3) catch by pointer;</p>
  
  <p>I only know that catch by value will invoke two copies of the object, catch by reference will invoke one. So how about catch by pointer? When to use catch by pointer? In addition to throw an object, can I throw a pointer to an object like this?</p>
  
  <pre><code>class A {}
  
  void f() {
  
    A *p = new A();
          throw p;
  
  
  }
  </code></pre>