Am 19.12.2010 02:56, schrieb Mateusz Loskot: > On 18/12/10 22:07, Maciej Sobczak wrote: >> On 18/12/2010 18:07, Mateusz Loskot wrote: >> >>> I have decided to apply it to the repository because as far as I see >>> it is not intrusive and it should not affect other users. >>> It's neat and makes the relevant code shorter. >> Thanks for applying the patch, but I was thinking about a possible >> increase in compile time. > I've measured compilation time of the postgresql/test including old and > new version of boost-fusion.h and the times are ~12 sec for both. > I don't see any noticeable difference, but I have no problem with > improving it. > >> Note that if the macro is not defined, it is set to 10 by default, which >> provides the same functionality as before the patch, just compiling >> longer. So, for those who accept 10 as the default limitation, things >> get worse in terms of longer compile time. > Good point. > >> What about this: >> >> #ifndef SOCI_MAX_FUSION_SEQUENCE_LENGTH >> >> // here old implementation >> >> #else >> >> #include<boost/preprocessor...> >> >> // ... new implementation >> >> #endif >> >> With this code structure those who accept the default limitation get >> fast compilation and those who want to tinker with the macro get more >> flexibility at the price of longer compile. >> >> This also means some code duplication (same functionality implemented in >> two different ways), so I'm not entirely sure if this is perfect. I will >> therefore ask for opinion those who use this more heavily. >> >> So? Does this dual-implementation make sense? > I'm fine with this solution. > > Jeff, Henning, are you happy with that too? > > Best regards, Hi,
somewhat :) If compile times are really a problem, then the best solution here seems to be a combination. That means there are up to 10 (arbitrarily chosen :) ) "unrolled" instantiations and if the user raises that limit, the remaining instantiations are generated by the PP. I think that is the way Boost.MPL works, too. Only that there is a generic implementation which uses the PP and then is preprocessed "offline" to generate the necessary files. Regards Henning ------------------------------------------------------------------------------ Lotusphere 2011 Register now for Lotusphere 2011 and learn how to connect the dots, take your collaborative environment to the next level, and enter the era of Social Business. http://p.sf.net/sfu/lotusphere-d2d _______________________________________________ Soci-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/soci-users
