title: A function that trys its argument function - Would that even be a good idea?
body: <p>Consider the following (not working) code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  
  void tried_function()
  {
      std::cout &lt;&lt; "Hello world";
  }
  
  void try_function (std::function function_to_try)
  {
      try
      {
          function_to_try();
      }
      catch(...)
      {
          //handle failed try here
      }
  }
  
  int main()
  {
      try_function(tried_function);
      return 0;
  }
  </code></pre>
  
  <p>Desired output:</p>
  
  <pre><code>Hello world!
  or errorhandling
  </code></pre>
  
  <p>You could expand the try-block to catch the most common exceptions and instead of writing a few try-blocks for all sorts of stuff you could just use the <code>try_function</code> and save a few keystrokes.</p>
  
  <p>But would that be a good idea or do I overlook something?</p>