
Hi Joel, "Joel de Guzman" <joel@boost-consulting.com> wrote
I'm interested. Spirit desperately needs a typeof mechanism, or better yet, an auto mechanism. It will make life so much happier :-)
What is "auto mechanism"? In RTL we use template argument deduction mechanism to make our relational expressions look decent. However, when the user needs to allocate a non-temporary object, she needs to specify the type explicitely, and this is where it becomes ugly. As you mentioned in the "typeof" section of Spirit documentation, what we really want (and what we need typeof for) is something like: ALLOCATE(expr, union(cross_product(t1, t2), selection(t3, _1[c1()]==15))); // use expr The type of our relational expression is an instantiation of a template, where most nodes are library-defined. However, the leaves are column names, and those are classes implicitely defined by the user. That's why I want to avoid explicit registration... There are two problems I can see here. One is related to getting a unique integer (what I am using __COUNTER__ for). I am trying to figure out the portable way of doing this (Paul just showed me something I think can work). Second -- registration is a specialization, and so has to be done out of global namespace (to get into the required namespace). This is also inconvenient. But, all this only required to handle user-created types. Is this an issue for Spirit?
However, it definitely has to be cross platform.
Sure :) Regards, Arkadiy