title: how do I fix this warning on CodeBlocks IDE, warning: catching polymorphic type 'class std::domain_error' by value [-Wcatch-value=]
body: <p>I have a throw domain_error("Student has done no homework") exception in my grade function, if the user does not enter homework grades, causing the vector to be size of 0. then I called this function in the main, within a try and catch block, and the compiler is giving the warning.</p>
  
  <p>Partial view of the main function </p>
  
  <pre><code>read_hw(cin,homework);
  try
  {
      double _final_grade = grade(midterm,_final,homework);
      streamsize prec = cout.precision();
      cout &lt;&lt; "Your final grade is "&lt;&lt;setprecision(3) &lt;&lt; _final_grade &lt;&lt; 
      setprecision(prec) &lt;&lt; endl;
  }
  catch(domain_error)
  {
      cout &lt;&lt; "You must enter your grades. Please try again" &lt;&lt;endl;
      return -1;
  }
  </code></pre>