Why we use the friend function in C ++

C ++ compiler error when mixing Variadic templates and Friend function

Problem Description

When declaring a Variadic function template as a friend of the class template, the C ++ compiler returns an error message instead of the code. For example, if you execute the following declaration:

You receive the following error message:

Error C2783: 'Void f (C , B)': Template argument for 'U' could not be derived

root cause

The cause is that the C ++ compiler can match the declaration of the friend function with an existing declaration.


This update is available from the Microsoft Download Center.

Microsoft Download Center

For more information about how to download Microsoft support files, click the following article number to view the article in the Microsoft Knowledge Base:

119591 How to obtain Microsoft support files from online services

Microsoft scanned this file for viruses. Microsoft was using the most recent virus-detection software available at the time the file was published. The file is stored on servers with increased security, which prevents unauthorized changes to the file.


This hotfix requires Visual Studio 2015 Update 3.

Reboot information

You must restart the computer after you apply this hotfix.


This hotfix does not replace any previously released hotfix.

File information

The English version of this hotfix has the file attributes (or later attributes) that are listed in the following table. The dates and times for these files are listed in coordinated universal time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the tab Time zone under Date and Time in the control panel.


File version

File size








32 PM



To work around this problem, do not declare the Variadic function template as a friend of the class template.