title: How to create an array of templated class objects?
body: <p>I haven't done any C++ programming for quite some time and I decided that I would mess around with it a little bit in my spare time so I decided to write me a little database program just for fun and I'm having trouble with creating an array of templated class objects.</p>
  
  <p>What I have is this class which I want to use to represent a field in a database record.</p>
  
  <pre><code>template &lt;class T, int fieldTypeId&gt;
  class Field
  {
  private:
      T field;
      int field_type;
  public:
      // ...
  };
  </code></pre>
  
  <p>And I want to use an array of that class to represent a record in a database using this class.</p>
  
  <pre><code>class Database_Record
  {
  private:
      int id;
      Field record[];
  public:
      Database_Record(int);
      Database_Record(int, Field[]);
     ~Database_Record();
  };
  </code></pre>
  
  <p>Where I'm stuck at is the creation of the array in the <code>Database_Record</code> class since that is an array of templated class objects with each element possibly being of a different type and I'm not sure how I need declare the array because of that. Is what I'm trying to do even possible or am I going about it the wrong way? Any help would be greatly appreciated.</p>