title: Multiple types in a single c++ vector
body: <p>I wonder if i could store different types of non-native data into a single vector?
  it goes like this:</p>
  
  <pre><code>class foo
  {
      private:
          int x;
      public:
          foo(int a=0):x(a){}
          int getx() { return x; }
          void setx(int a=0) { x=a; }
  };
  class var:public foo
  {
      private:
          int y;
      public:
          var(int a=0, int b=0):foo(a), y(b){}
          int gety() { return y; }
          void sety(int a=0) { y=a; }
  };
  class var1:public foo
  {
      private:
          int z;
      public:
          var(int a=0, int b=0):foo(a), z(b){}
          int getz() { return z; }
          void setz(int a=0) { z=a; }
  };
  </code></pre>
  
  <p>How to declare a vector to hold data of both <code>var</code> and <code>var1</code> types?
  I could store them in a <code>std::vector&lt;foo&gt;</code>, but then they'd be treated as if they are of <code>foo</code> types</p>