Boost logo

Boost Users :

Subject: [Boost-users] [Boost::mpl] transforming expression both at compile time and runtime
From: Noman Javed (noman_bwp_at_[hidden])
Date: 2010-08-16 10:26:01


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net