
I encountered a rather amusing/horrible compiler error today when trying to wrap my head around the new Spirit.
Apparently, VC++10 experiences a fatal internal compiler error when defining a Karma or Qi rule inside a lambda expression, as shown in the attached source at the bottom of this mail (and in the bug report).
I reported a spirit bug [1] and a kind soul on the #boost channel linked me a similar Microsoft Connect bug [2], which seems to have sadly been ignored.
I've got no idea in what edge of Spirit to start investigating this, as there's deep magic going on inside it, and would appreciate advice on what might be at fault, and whether there are any knobs I can twiddle.
Could it be related to the recent thread on incomplete decltypes and odd rvalue references that VC10 has?
[1] https://svn.boost.org/trac/boost/ticket/4160 [2] http://connect.microsoft.com/VisualStudio/feedback/details/541534/intern al-compiler-error-in-lambda-expression#
//---8<--- #include <boost/spirit/include/karma.hpp>
int main() { []() { boost::spirit::karma::rule<char*> r; }; } //---8<---
The code you gave compiles just fine using g++ with --std=c++0x (I tried V4.3.4). So I'm really not sure what we could do about this. So this is not an issue related to Spirit in any way. VC10 has some basic support for C++0x lambdas, but it seems to be too buggy to be useful. I'd suggest to wait for an update, but wouldn't hold my breath. Regards Hartmut --------------- Meet me at BoostCon www.boostcon.com