title: C++ Polymorphism and Vectors, pointing a derived class of vectors to a base class of vectors
body: <p>Say:
  Apple is derived from a base Fruit Class, then there is a class ApplePicker derived from a base FruitPicker class.<br>
  The ApplePicker class has <code>vector&lt;Apple&gt; appleList</code>, the Fruit picker class has a pointer to a <code>vector&lt;Fruit&gt;</code> i.e. <code>vector&lt;fruit&gt;* fruitList</code>.</p>
  
  <p>I need to be able to set the vector to this pointer, so abstract methods can be run in the fruit picker class(as they only are concerned with the fruit members). But I am having trouble setting this, when I tried to do this:</p>
  
  <pre><code>this-&gt;fruitList = &amp;(this-&gt;AppleList);
  </code></pre>
  
  <p>It gives me the error <code>cannot convert to vector&lt;Apple&gt; to vector&lt;Fruit&gt;</code>. I tried static cast and it gave me the same error. I did a similar thing to a non-vector base class and derived class and it was fine.</p>
  
  <p>I am new to C++, and I am using it on Android via NDK. </p>
  
  <p>So is what I am trying to do impossible and I have to use a vector of pointers like <code>vector&lt;Fruit*&gt;</code>.</p>