title: Why does the creation of a vector storing base objects, but being initialized with derived objects fail with a deleted move constructor?
body: <p>I am attempting to create a <code>std::vector&lt;SystemBase&gt;</code> class member that stores multiple systems that all derive from <code>SystemBase</code>. However this class has a reference and thus has no sensible default constructor:</p>
  <pre class="lang-cpp prettyprint-override"><code>class SystemBase {
  public:
    SystemBase() = delete;
    explicit SystemBase(entt::registry &amp;Registry) : Registry{Registry} {}
    virtual ~SystemBase() = default;
  
    SystemBase(const SystemBase &amp;) = delete;
    SystemBase(SystemBase &amp;&amp;) = delete;
    auto operator=(const SystemBase &amp;) -&gt; SystemBase &amp; = delete;
    auto operator=(SystemBase &amp;&amp;) -&gt; SystemBase &amp; = delete;
  
    virtual auto update(const sf::Time DeltaTime) const -&gt; void;
  
  protected:
    entt::registry &amp;Registry;
  };
  </code></pre>
  <p>A system that inherits looks as follows:</p>
  <pre class="lang-cpp prettyprint-override"><code>class LocalToWorldSystem final : public SystemBase {
  public:
    explicit LocalToWorldSystem(entt::registry &amp;Registry) : SystemBase{Registry} {};
    auto update(const sf::Time DeltaTime) const -&gt; void override;
  };
  </code></pre>
  <p>When trying to initialize a vector of systems I get an error:</p>
  <pre class="lang-cpp prettyprint-override"><code>std::vector&lt;SystemBase&gt; Systems{LocalToWorldSystem{Registry}};
  //                              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  // Error: Call to deleted constructor of 'const SystemBase'.
  </code></pre>
  <p>Why does this happen? My current workaround is to use a <code>std::vector&lt;std::unique_ptr&lt;SystemBase&gt;&gt;</code> but I'd like to know why this issue pops up in the first place.</p>