|
Boost Users : |
Subject: Re: [Boost-users] [MSM] Solution for: fatal error C1202: recursive type or function dependency context too complex RE-POST
From: christophe.j.henry_at_[hidden]
Date: 2015-10-29 02:56:01
>I have had a major headache while using MSM eUML state transition tables,
>thankfully I've found a simple solution.
>First MSM and especially eUML are great, and that's why I persevered to
>find a solution.
>
>Here's the problem:
>
>Declaring a complex eUML state transition table may result in the compiler
>generating an error.
>
>BOOST_MSM_EUML_DECLARE_TRANSITION_TABLE((
>// row_1,
>// row_2,
>// ...
>// row_a,
>// row_b,
>// row_c,
>//
>// Eventually the Microsoft compiler VS2008,2010,2012,2015 will all explode
>with fatal C1202: recursive type or function dependency context too complex
>), transition_table );
>
>I haven't tried with gcc.
>
>The solution is to break the state table in two smaller parts rather than
>one big table:
>
>BOOST_MSM_EUML_DECLARE_TRANSITION_TABLE((
>// row_1,
>// row_2,
>// ...
>), transition_table_part_1 );
>
>BOOST_MSM_EUML_DECLARE_TRANSITION_TABLE((
>// row_a,
>// row_b,
>// row_c
>), transition_table_part_2 );
>
>typedef boost::mpl::joint_view< transition_table_part_1,
>transition_table_part_2 > transition_table; // No error, even though it
>contains just as many rows
<snip>
>Christophe:
>Would you consider adding the example above to the MSM documentation, I
>would suggest under:
>Chapter 4, Compilers / Performance, Compilers Corner
>
>Also under:
>Chapter 5, Questions Answers and Tips:
>
>Question: Why do I get "fatal C1202: recursive type or function dependency
>context too complex"
>Answer: Likely because a state transition table has become two complex.
>Split the state transition table into two parts, and then use typedef
>mpl::joint_view< transition_table_part_1,
>transition_table_part_2 > transition_table to join the two parts.
>
>Question: Why does my compiler generate a fatal out of memory fatal error.
>Answer: Likely because a state transition table has become two complex.
>Try and split the most complex state transition table into two parts, and
>then use typedef mpl::joint_view< >transition_table_part_1,
>transition_table_part_2 >
>transition_table to join the two parts.
>
>
>- Mark Bartosik
Hi Mark,
very interesting indeed! Actually I like it so much that I tried it under
gcc and clang. Unfortunately (so to say ;-) ) these are good compilers so
they don't need this trick. It even increases the compile-time.
Which doen't mean the solution is bad.
I will simply add it to the doc, as you suggested, with the indication it is
for VC.
Thanks for the very good idea!
Regards,
Christophe
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net