The comparison for templates is with generics, which are implemented in a similar way but they require type class (trait) bounds specified for everything that's used, rather than expanding and pattern matching. There's not template meta-programming in the same sense as C++.