title: Replacement for vector accepting non standard constructable and not assignable types
body: <p>I have a class <code>test</code> which isn't standard constructable nor assignable due to certain reasons. However it is copy constructable - on may say it behaves a bit like a reference.</p>
  
  <p>Unfortunately I needed a dynamic array of these elements and realized that <code>vector&lt;test&gt;</code> isn't the right choice because the elements of a vector must be standard constructable and assignable. Fortunately I got around this problem by </p>
  
  <ul>
  <li>using <code>vector&lt;T&gt;::reserve</code> and <code>vector&lt;T&gt;::push_back</code> instead of <code>vector&lt;T&gt;::resize</code> and direct filling the entries (no standard construction)</li>
  <li><p>the copy'n'swap trick for assignment and the fact that a <code>vector</code> is usually implemented using the Pimpl-idiom (no direct assignment of an existing  <code>test</code> element), i.e</p>
  
  <pre><code>class base {
  private:
      std::vector&lt;test&gt; vect;
      /* ... */
  public:
      /* ... */
      base&amp; operator= (base y) {
          swap(y);
          return *this;
      }
      void swap(base&amp; y) {
          using std::swap;
          swap(vect, y.vect);
      }
     /* ... */
  };
  </code></pre></li>
  </ul>
  
  <p>Now I assume that I probably didn't considered every tiny bit and above all these tricks are strongly implementation dependent. The standard only guarantees standard behavior for standard constructable and assignable types.</p>
  
  <p>Now what's next? How can I get a dynamic array of <code>test</code> objects?</p>
  
  <p><b>Remark:</b> I must prefer built in solutions and classes provided by the standard C++.</p>
  
  <p><b>Edit:</b> I just realized that my tricks actually didn't work. If I define a really* non assignable class I get plenty of errors on my compiler. So the question condenses to the last question: <i>How can I have a dynamic array of these <code>test</code> objects?</i></p>
  
  <p>(*) My <code>test</code> class provided an assignment operator but this one worked like the assignment to a reference.</p>