title: How does =delete on destructor prevent stack allocation?
body: <p>In this <a href="https://stackoverflow.com/questions/18841747/what-are-some-uses-for-delete/">SO question</a> is stated that this construct prevents stack allocation of instance.</p>
  
  <pre><code>class FS_Only {
      ~FS_Only() = delete;  // disallow stack allocation
  };
  </code></pre>
  
  <p>My question is, how does it prevents allocation? I understand, that is not possible to delete this instance, either explicitly or implicitly. But I think, that would lead to memory leak or run time error, respectively.</p>
  
  <p>Are compilers smart enough to sort this out and raise compiler error? Also why would one need this?</p>