title: Templated classes in a union?
body: <p>I'm trying to get the maximum size of any possible instance of my template as a compile time constant. The first thing that came to mind was something like this...</p>
  
  <pre><code>union TestUnion
  {
   template&lt;typename T&gt; class MyClass
   {
   public:
    MyClass() { };
    MyClass(T&amp; t) : _t(t) { }
  
   private:
    T _t;
   };
  };
  </code></pre>
  
  <p>But <code>sizeof(TestUnion)</code> is always equal to 1, but <code>sizeof(MyClass&lt;int&gt;)</code> for instance, correctly returns 4. Anyone have any better ideas?</p>