title: boost date time catching exception
body: <p>I'm trying to check if a date is valid using boost <code>date_time</code>. The documentation says it will throw an exception if the date is invalid. Now I've been trying to use try-catch if the date is indeed invalid but somehow my program still gets thrown out and stops..</p>
  
  <p>simple test code:</p>
  
  <pre><code>#include "boost/date_time/gregorian/gregorian.hpp"
  #include &lt;iostream&gt;
  
  int main()
  {
      int year = 2013;
      int month = 1;
      int day = 50;
  
      try
      {
          boost::gregorian::date d(year, month, day);
  
          throw 20;
      }
      catch (int e)
      {
          std::cout &lt;&lt; "error! date does not excist!" &lt;&lt; std::endl;
          std::cout &lt;&lt; "error no: " &lt;&lt; e &lt;&lt; std::endl;
      }
  
      return 0;
  }
  </code></pre>
  
  <p>final question:
  what is the proper way using date_time to validate a date?</p>