Alexandrescu's Modern C++ design taught me how to template properly. Also, Scott Meyers's books were very helpful. The design of the D standard library has also been very influential on my code (Mainly convincing me of the benefits of ranges over iterator)
Also recommended in this reply