Templates are useful when you need to use the standard containers.
When you start doing metaprogramming beyound that, guys like me start to get very nervous.
When you start doing metaprogramming beyound that, guys like me start to get very nervous.
1) "Java" generics. That is, anything you could do with generics in Java. No one should have an issue using templates like this.
2) Non-recursive "typedef" programming. That is, uses like "::value_type" in the STL containers. These are incredibly useful to have around when writing generic algorithms, but their overuse leads to unparseable code to some set of C++ programmers. Use with caution, but still use.
3) Recursive templates and other subtle uses I haven't covered with the above two. Try very, very, very hard to avoid.
That makes the "will my coworkers understand this code?" question very easy to answer.
:-)