title: Exception vs Assert?
body: <blockquote>
  <p><strong>Possible Duplicate:</strong><br />
  <a href="https://stackoverflow.com/questions/117171/design-by-contract-tests-by-assert-or-by-exception">design by contract tests by assert or by exception?</a></p>
  </blockquote>
  
  <p>Is there a rule of thumb to follow when deciding to use exceptions instead of asserts (or vice versa). Right now I do only throw if it's something I think will happen during runtime on the user side (like a socket or file error). Almost everything else I use asserts.</p>
  <p>Also, if I were to throw an assert, what is a nice standard object to throw? If I recall correctly there is <code>std::logic_error</code>, but is that not a good object to throw? What would I throw for a missing file or unexpected input (such as from the command line instead of a frontend app)?</p>