title: Exceptions handling guidelines for C++
body: <p>I understand benefits of using exceptions handling in C++ and I'm aware that it may be tricky. One of rule says, that every function may throw. Ok, but there are situations, where we want to make sure, that function does not throw. I'm looking for any well-known practices or guidelines for handling such situations. Examples:</p>
  
  <pre><code>try
  {
      // do something
  }
  catch (std::runtime_error&amp; error)
  {
      save_log (error);
      emit_dbus_signal (error);
  }
  </code></pre>
  
  <p>I don't care if <code>save_log()</code> or <code>emit_dbus_signal()</code> will fail, I only want to make sure, that I tried to call them. </p>
  
  <pre><code>ThreadPool thread_pool;
  SocketsPool socket_pool;
  MainLoop main_loop;
  
  try
  {
      thread_pool.init ();
      socket_pool.init ();
  
      main_loop.run ();
  }
  catch (std::runtime_error&amp; error)
  {
      save_log (error);
      emit_dbus_signal (error);
  }
  
  thread_pool.finalize ();
  socket_pool.finalize ();
  </code></pre>
  
  <p>I only want to make sure, that I tried to finalize <code>thread_pool</code> and <code>socket_pool</code>. Any error during finalization process should be handled inside <code>finalize()</code> methods.</p>
  
  <p>I can remember, which functions does not throw, but it will work only for small programs. Should I add suffix like <code>_nothrow</code> to such "non throwing" functions' names and handle this while writing code? Exceptions specification is deprecated since C++11 so I want to avoid it. What about <code>noexcept</code>? I still not sure if I understand this new feature. Is it what I'm looking for? </p>
  
  <p>There's no excpetions checking at compile time in C++11 right?</p>
  
  <p>Or maybe I'm completely wring? :)</p>