Creating a template instance - this function, so I just call him void f<int>().
You need a preliminary announcement:
[C++03: 11.4/9 | C++11/C++14: 11.3/11]: (9.8), , , . , , . [..]
( friend -inside-template-declaration, , .)
:
#include <iostream>
template <class T>
void f();
class S {
static const int i = 42;
friend void f<int>();
};
template <class T>
void f()
{
std::cout << S::i << "\n";
}
int main()
{
f<int>();
f<double>();
}
f<double>().
( )