any design patterns and programming idioms rely on the use of friend declarations
. However, when friend declarations are used in templates, the obfuscated syntax can bewilder even expert programmers. This month's solution demonstrates how to fine-tune friend declarations, while overcoming the syntax barrier at the same time.
How do you declare a template as a friend of another template? How can you distinguish between a specialization and a primary template in such declarations? What if you need to declare an asymmetric overloaded operator as a friend?
Follow the guidelines and rules set forth in this solution.