Hi I have just started experimenting with proto. I have the following grammer G ::= Apply f G | Arrray where the code of the simple array and apply classes are given below: How can I transform this code in the proto template<typename T> class Array { public: Array(int size) : size(size) { data = new T[size]; } operator=() { ... } private: int size; T* data; }; I have another class apply that applies the function (its first argument) on its other arguments template<typename F, typename EXP> struct apply { Array<typename F::result_type>& operator()(EXP & exp) { ... } typename F::result_type operator[](typename F::input_type i) { return f(i); } }; The Apply class can be a unary or binary or infact an n-ary class. How can I protofy this expression template? Regards Noman Javed Orléans, France |