title: Is the Rule of 5 (for constructors and destructors) outdated?
body: <p>The rule of 5 states that if a class has a user-declared destructor, copy constructor, copy assignment constructor, move constructor, or move assignment constructor, then it must have the other 4.</p>
  <p>But today it dawned on me: when do you ever need a user-defined destructor, copy constructor, copy assignment constructor, move constructor, or move assignment constructor?</p>
  <p>In my understanding, implicit constructors / destructors work just fine for aggregate data structures. However, classes which manage a resource need user-defined constructors / destructors.</p>
  <p>However, can't all resource managing classes be converted into an aggregate data structure using a smart pointer?</p>
  <p>Example:</p>
  <pre><code>// RAII Class which allocates memory on the heap.
  class ResourceManager {
      Resource* resource;
      ResourceManager() {resource = new Resource;}
      // In this class you need all the destructors/ copy ctor/ move ctor etc...
      // I haven't written them as they are trivial to implement
  };
  </code></pre>
  <p>vs</p>
  <pre><code>class ResourceManager {
      std::unique_ptr&lt;Resource&gt; resource;
  };
  </code></pre>
  <p>Now example 2 behaves exactly the same as example 1, but all the implicit constructors work.</p>
  <p>Of course, you can't copy <code>ResourceManager</code>, but if you want a different behavior, you can use a different smart pointer.</p>
  <p>The point is that you don't need user-defined constructors when smart pointers already have those so implicit constructors work.</p>
  <p>The only reason I would see to have user-defined constructors would be when:</p>
  <ol>
  <li><p>you can't use smart pointers in some low-level code (I highly doubt this is ever the case).</p>
  </li>
  <li><p>you are implementing the smart pointers themselves.</p>
  </li>
  </ol>
  <p>However, in normal code I don't see any reason to use user-defined constructors.</p>
  <p>Am I missing something here?</p>