C++ Template Meta Programming Function Algebra