title: Template class and derived classes
body: <p>I have templated <code>MyDatabase</code> class and two derived classes <code>Database_A</code> and <code>Database_B</code>. I have another class <code>C</code> which is using <code>Database_A</code> and <code>Database_B</code>. So, whenever I am including headers of both derived class (<code>Database_A</code> and <code>Database_B</code>) in class <code>C</code>, it gives me this error "Redefinition of <code>MyDatabase</code>". My guessing is, because both derived class (<code>Database_A</code> and <code>Database_B</code>) are dragging template class <code>MyDatabase</code>, it could be the reason for redefinition of <code>MyDatabase</code>. But I don't know how to resolve this problem.</p>
  
  <p>My code:</p>
  
  <pre><code> template &lt;typename U, class T&gt; class My_DataBase {
       protected:
       std::map&lt;U,T&gt; Container
       public:
       void add();
       T* getNameToPointer(string key);
   };
  
   class Database_A: public My_Database &lt;string,A&gt; {
       add();
       A* getNameToPointer(name);
   };
  
   class Database_B: public My_DataBase &lt;string,B&gt; {
       add();
       B* getNameToPointer(name);
   };
  
   class C {
       private:
       Database_A Db_A;    // drage template class on back_end
       Database_B Db_B;    // drage template class on back_end
   };
  </code></pre>
  
  <p>How can I solve this problem?</p>