From: Tobias Schwinger (tschwinger_at_[hidden])
Date: 2006-01-12 18:42:35
Arkadiy Vertleyb wrote:
> "Tobias Schwinger" <tschwinger_at_[hidden]> wrote
>>There was another typo in preprocess.pl
>> #include <boost/mpl/vector.hpp>
>> #include <boost/typeof/vector.hpp>
> Now it's working...
It was about time ;-).
> However I ran into a problem that I think needs to be addressed somehow,
> namely even if LIMIT_SIZE is set to, say, 60, the vector100.hpp gets
> included, and vc71 fails due to max number of template parameters exeeded
> (although it can be worked around by defining the preprocessing mode).
> It's possible that other compilers might have similar problem.
> It should be possible to define a macro (or header) which would create
> vector specializations from m to n, and then use this macro to generate
> preprocessed files. Then vector.hpp would look something like this:
> #if LIMIT_SIZE < 50
> REGISTER_VECTOR(0, LIMIT_SIZE)
> #elif LIMIT_SIZE < 100
> #include <boost/typeof/vector50.hpp>
> REGISTER_VECTOR(50, LIMIT_SIZE)
> #elif ...
> This would become slower for intermediate numbers, since up to 50
> specializations might need to be generated on the fly...
Well, I just implemented this kind of "partial preprocessing".
LIMIT_SIZE | seconds
49 & | 5
50 & | 2
149 | 36
150 * | 19
199 | 50
200 * | 23
238 # | 49
(&) only #include <boost/typeof/typeof.hpp> used for these cases
(*) no preprocessing needed in these cases
(#) maximum, due to MSVC8 preprocessor limits
The (tested ;-) ) code:
Adding preprocessed files for the exact maxima of the compilers in question with
the previous version could be an alternative.
Of course this technique can be applied to the "partial preprocessing" version as
well (in case it turns out there is a compiler which allows e.g. at most 199
template parameters, for instance).
Boost list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk