
"Tobias Schwinger" <tschwinger@neoscientists.org> wrote
Recently I discovered that setting LIMIT_SIZE > 117 with MSVC8 produces an error:
...typeof/vector.hpp(58) : fatal error C1009: compiler limit : macros nested too deeply
That's quite unfortunate because frameworks such as Spirit easily produce type expressions too complex for this setting.
Well, we're at the preprocessor's and not the compiler's limits so we can do something about it:
Changing the outer loops in typeof/vector.hpp to use BOOST_PP_LOCAL_ITERATE instead of BOOST_PP_REPEAT buys us a new maximum of 238 (and the same error for higher values, so it's still the preprocessor's limit).
OK, but this means we have to change the syntax of REGISTER macros to do something like: #include BOOST_TYPEOF_REGISTER_...(...) I remember you suggested this during the review. I am still not quite comfortable with the idea...
While testing my hack described above I recognized that preprocessing typeof/vector.hpp takes unpleasantly long, so I decided to kill two birds with one stone by improving performance and pushing the limits even further. That is making typeof/vector.hpp load preprocessed files for LIMIT_SIZE e { 50,100,150,200,250 }. For the maximum: 250 be it - it's getting quite close to the limits of Boost.Preprocessor (and I still don't know the maximum number of template parameters allowed with MSVC8 ;-).
Here's my modifications:
How much faster is it? Regards, Arkadiy