C++ meta-function over templates
问题 I have some templates like the ones below that I can use to define simple expressions e.g. Expr<constant,int,int,1,1> = 2 Expr<sub, Expr<constant,int,int,1,1>, Expr<constant,int,int,2,0>, 1, 1> = x - 2. I want to define a meta-function that takes an Expr and returns another Expr that is a modified version of the one passed as input. The output will be based on the template arguments of the input so I guess I have to define multiple function templates that specialize different inputs.