Visual Studio 2010 Template Limits

I have written some code that makes heavy use of templates and which compiles just fine using g++; however, when I recently tried to compile the code in VC++ 2010 I got a fatal error C1063: compiler limit : compiler stack overflow. It directs me to this template... See reference to class template instantiation 'delegate<T1>::overloads<1,S0,ptr0>' being compiled The general code structure is... template<T1> class delegate { template<typename RTN, typename TY PARAM_TNS, RTN (TY::*m_ptr)(PARAM_PTS)> class method_impl<RTN (TY::*)(PARAM_PTS), m_ptr> : public method; // specialized for n with BOOST_PP_ITERATE (blows up even if n == 1) template<int, typename S0, S0 ptr0> class overloads<n, PARAM_TYPES> : public method_impl<S0,ptr0>, public method_impl<S1,ptr1> ... { }; }; I don¹t even need to instantiate delegate<ForSomeType>, simply including the header causes it to blow up. Considering the extent to which boost uses and ³abuses² templates I thought I would ask whether anyone here knows of some limitation or constructs which I must avoid? Is there some way to increase the ³stack² for VC++¹s CL program? Dan

[Daniel Larimer]
If you send a self-contained test case to me (ideally a single source file and a command line to compile it like cl /EHsc /nologo /W4 meow.cpp), I'll file a compiler bug for you. (Using Boost is okay, but if you have a test case that doesn't use Boost, that's even better.) You can also file bugs yourself. Follow the instructions at http://blogs.msdn.com/vcblog/archive/2009/11/10/steps-to-open-actionable-bug... . Thanks, Stephan T. Lavavej Visual C++ Libraries Developer
participants (2)
-
Daniel Larimer
-
Stephan T. Lavavej