Qualified friend function template instantiation

后端 未结 1 1513
野性不改
野性不改 2020-12-21 23:53

Looking at C++ Templates: The Complete Guide (2nd Edition)/official site this morning I came across a section I can\'t quite make sense out of (12.5.2 if you have the book).

相关标签:
1条回答
  • 2020-12-22 00:31

    The book is right. [temp.friend]p1 - with the relevant part highlighted:

    For a friend function declaration that is not a template declaration:

    • if the name of the friend is a qualified or unqualified template-id, [...]

    • if the name of the friend is a qualified-id and a matching non-template function is found in the specified class or namespace, [...]

    • if the name of the friend is a qualified-id and a matching function template is found in the specified class or namespace, the friend declaration refers to the deduced specialization of that function template

    • [...]

    0 讨论(0)
提交回复
热议问题