title: Boost Variant with base class causes 'C1060 compiler is out of heap space'
body: <p>I'm hoping someone here has a workaround for this. This code compiles fine on gcc, and VS2010 SP1 (Debug x32, Release x32, Debug x64), but fails for 64 bit Release builds with a fatal error C1060: compiler is out of heap space. I'm using Boost 1.52</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;boost/variant.hpp&gt;
  #include &lt;string&gt;
  #include &lt;vector&gt;
  #include &lt;map&gt;
  
  typedef boost::make_recursive_variant&lt;
      boost::blank,
      std::string,
      int,
      double,
      std::vector&lt;std::vector&lt;int&gt; &gt;,
      std::vector&lt;std::vector&lt;double&gt; &gt;,
      std::vector&lt;std::vector&lt;std::string&gt; &gt;,
      std::map&lt;std::string, std::vector&lt;std::string&gt; &gt;,
      std::map&lt;std::string, std::vector&lt;double&gt; &gt;,
      std::map&lt;std::string, std::vector&lt;int&gt; &gt;,
      std::map&lt;std::string,boost::recursive_variant_&gt;
  &gt;::type InfoHolder2;
  
  class Test
  {
      InfoHolder2 test;
  };
  
  class Test3
  {};
  
  class Test4
  {};
  
  template &lt;class T&gt;
  class Base
  {
  public:
      Base(){};
      virtual std::string Foo(const T&amp; val, const std::string&amp; header = "")  const = 0;
      virtual T Bar(const std::string&amp; buffer, size_t offset = 0) const = 0;
  };
  
  template &lt;class Payload, class iArchive, class oArchive&gt; 
  class TestSer : Base&lt;Payload&gt;
  {
  public:
      TestSer():Base()
      {    }
  
      virtual std::string Foo(const Payload&amp; holder,const std::string&amp; header = "") const
      {
          return "";
      }
  
      virtual Payload Bar( const std::string&amp; buffer, size_t offset = 0) const
      {   
          Payload retval;
          return retval;
      }
  };
  
  
  int _tmain(int argc, _TCHAR* argv[])
  {
      new TestSer&lt;Test, Test3, Test4&gt;();
      return 0;
  }
  </code></pre>
  
  <p>This fails every time. If I reduce the number of elements the variant can handle I can get it to compile, but that isn't really preferred as this works nicely for me. If I change the class to the version below, it works. Does anyone have any ideas for workarounds?</p>
  
  <pre><code>template &lt;class Payload, class iArchive, class oArchive&gt; 
  class TestSer 
  {
  public:
      TestSer()
      {    }
  
      std::string Foo(const Payload&amp; holder,const std::string&amp; header = "") const
      {
          return "";
      }
  
      Payload Bar( const std::string&amp; buffer, size_t offset = 0) const
      {   
          Payload retval;
          return retval;
      }
  
  };
  </code></pre>