title: Confused about std::runtime_error vs. std::logic_error
body: <p>I recently saw that the boost program_options library throws a <code>logic_error</code> if the command-line input was un-parsable.  That challenged my assumptions about <code>logic_error</code> vs. <code>runtime_error</code>.  </p>
  
  <p>I assumed that logic errors (<code>logic_error</code> and its derived classes) were problems that resulted from internal failures to adhere to program invariants, often in the form of illegal arguments to internal API's.  In that sense they are largely equivalent to ASSERT's, but meant to be used in released code (unlike ASSERT's which are not usually compiled into released code.) They are useful in situations where it is infeasible to integrate separate software components in debug/test builds or the consequences of a failure are such that it is important to give runtime feedback about the invalid invariant condition to the user.</p>
  
  <p>Similarly, I thought that <code>runtime_error</code>s resulted exclusively from runtime conditions outside of the control of the programmer: I/O errors, invalid user input, etc.</p>
  
  <p>However, program_options is obviously heavily (primarily?) used as a means of parsing end-user input, so under my mental model it certainly should throw a <code>runtime_error</code> in the case of bad input.</p>
  
  <p>Where am I going wrong?  Do you agree with the boost model of exception typing?</p>