title: Is there a generally accepted idiom for indicating C++ code can throw exceptions?
body: <p>I have seen problems when using C++ code that, unexpectedly to the caller, throws an exception. It's not always possible or practical to read every line of a module that you are using to see if it throws exceptions and if so, what type of exception.</p>
  
  <p>Are there established idioms or "best practices" that exist for dealing with this problem?</p>
  
  <p>I've thought of the following:  </p>
  
  <ol>
  <li><p>In our doxygen documentation, we could add a comment in every function that is expected to throw an exception and it's type(s).  </p>
  
  <ul>
  <li>Pluses: Simple.  </li>
  <li>Minuses: Subject to user error.  </li>
  </ul></li>
  <li><p>We could have an app-wide <code>try/catch(...)</code> for safety.  </p>
  
  <ul>
  <li>Pluses: We won't have any more uncaught exceptions.  </li>
  <li>Minuses: The exception is caught far away from the throw. It's hard to figure out what to do or what went wrong.</li>
  </ul></li>
  <li><p>Use Exception Specifications  </p>
  
  <ul>
  <li>Pluses: This is the language-sanctioned way of dealing with this problem.  </li>
  <li>Minuses: Refactoring of problem libraries needed for this to be effective. Not enforced at compile-time, so violations turn into run-time problems, which is what I'm trying to avoid!</li>
  </ul></li>
  </ol>
  
  <p>Any experiences with these methods, or any additional methods that I'm unaware of?</p>