fusion Transformation function passed to transform
Hello,
The transformation function to pass to fusion::transform() function and metafunction are hard to get right, in particular the embedded inner result struct because of the fact that the template argument of result is a "function signature"
There is only the 1 simple example in libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/transform.html
I for one would love to see another example where the fusion vector has different types, and where the result of transformation function depends on each type of the sequence transform is applied on.
In the meantime, I am writing something like this:
struct extract_rule {
template <typename Signature> struct result; //// primary template
template <typename Holder> struct result< extract_rule(const Holder) > { //// is this always a specialization of the primary?
typedef .... type;
};
template <typename Holder>
typename result
On 2/26/2010 12:59 AM, Hicham Mouline wrote:
Hello,
The transformation function to pass to fusion::transform() function and metafunction are hard to get right, in particular the embedded inner result struct because of the fact that the template argument of result is a "function signature"
It assumes familiarity with the result_of protocol. See http://www.boost.org/doc/libs/1_42_0/libs/utility/utility.htm#result_of There's even a technical report on the matter.
There is only the 1 simple example in libs/fusion/doc/html/fusion/algorithm/transformation/metafunctions/transform.html
I for one would love to see another example where the fusion vector has different types, and where the result of transformation function depends on each type of the sequence transform is applied on.
Always check the example and test directories to see more examples. Regards, -- Joel de Guzman http://www.boostpro.com http://spirit.sf.net http://www.facebook.com/djowel Meet me at BoostCon http://www.boostcon.com/home http://www.facebook.com/boostcon
participants (2)
-
Hicham Mouline
-
Joel de Guzman