title: Generic handle class
body: <p>I stumbled onto this problem: <a href="https://stackoverflow.com/questions/15756960/using-unique-ptr-to-control-a-file-descriptor">Using unique_ptr to control a file descriptor</a>. The <code>std::unique_ptr</code> is not really appropriate for a general handle. So is the more general class</p>
  
  <pre><code>template&lt;class HandleType,HandleType nullvalue,class Deleter&gt;
  class Handle;
  </code></pre>
  
  <p>already implemented (maybe in boost), or should I roll my own. This question has been raised before in 
  <a href="https://stackoverflow.com/questions/2433240/what-wrapper-class-in-c-should-i-use-for-automated-resource-management">What wrapper class in C++ should I use for automated resource management?</a>, but now we have C++14 so there can be more alternatives.</p>
  
  <p>I also found the following proposal: <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3677.html" rel="nofollow noreferrer">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3677.html</a>. So someone else has also thought about this problem.</p>