On 05/19/14 12:42, Louis Dionne wrote:
Hartmut Kaiser
writes: [snip] Moreover, Christopher Schmidt finished a full C++11 rewrite of Fusion during GSoC 2009. It might be a good idea to go back and look what he came up with.
Thanks for the heads up. Is there a link to that code, or is it already in the Boost distribution? [snip] Unfortunately not. There is this:
http://svn.boost.org/svn/boost/sandbox/SOC/2009/fusion/README however, the link mentioned there no longer works. I did work some with Christopher in comparing implementations of tuple. The mailing list thread starts here: http://article.gmane.org/gmane.comp.lib.boost.devel/194327 I do have some downloads of the slim code he mentioned in the README link; however, IIRC the code here: https://svn.boost.org/svn/boost/sandbox/variadic_templates/sandbox/slim/test... contains a simplified version of the slim code which may give you some idea of how it was implemented. IIRC, the boost pp was used somewhat like the current fusion uses it; however, Christopher used inheritance to provide the tail of the tuple. Also, just like fusion, Christopher divided the tuple into "chunks" of a given size, which, IIRC, was 10. Each chunk, like fusion, had variables m1...m10 declared with T1...T10 which were the head template arguments. Have a look at: https://svn.boost.org/svn/boost/sandbox/variadic_templates/sandbox/slim/test... for a more concrete idea (I'd suggest running through the preprocessor then indent, to make things clearer). I think the chunk size is given by the UNROLL_MAX macro in that file. However, I've just briefly glanced over the code again; so, this explanation may be a bit flawed. HTH. -regards, Larry