Basic class templating in C++
<p>I have to two class,</p>

<pre><code>class CFoo
{
   public:
      static CFoo&amp; GetInstance()
      {
         static CFoo instance;
         return instance;
      }

      int GetValue(){
         return value;
      }

   private:
      CFoo(){
         value = 0;
         ltr = 'a';
      }

      int value;
      char ltr;
};

class CBar
{
   public:
      static CBar&amp; GetInstance(){
         static CBar instance;
         return instance;
      }

      float GetValue(){
         return value;
      }

   private:
      CBar(){
         value = 0.4;
         ltr = 2;
      }

      float value;
      int ltr;
};
</code></pre>

<p>Is it possible just to create a class template for this two class , the difference is just the data types. And since the class is a singleton, how can I invoke when I create a template class for this two class? And please give example code for the basic template class.</p>

<p>Please advice.</p>

<p>Many thanks.</p>
