
Can someone guide me how to transform an expression both at compile time and at runtime? I explain by an example Suppose I want to transform the following expression like that foo(f,other(g,bar)) --> other(g,foo(f,bar)) where bar is an Array and the "foo" and "other" are the higher order functions. I can write the metafunction for transforming the type of the expression i.e from Foo<F, Other<G, Array> > --> Other<G, Foo<F, Array> > I want to execute this expression in the following way Array result = foo(f, other(g, bar)) where within the body of the operator= overload of the Array class I have the function transform to transform this expression as said above. The problem is that how can I write the runtime equivalent of the metafunction transform or is there some other way possible? Thanking in anticipation Noman