forked from qt-creator/qt-creator
Change-Id: I6474fbe4f43daaac930ad6ba49fd9cb3145a3bbd Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
42 lines
537 B
C++
42 lines
537 B
C++
void function();
|
|
|
|
void function()
|
|
{
|
|
int x;
|
|
x = 20;
|
|
}
|
|
|
|
template <typename T>
|
|
T templateFunction(T t)
|
|
{
|
|
return t;
|
|
}
|
|
|
|
template <>
|
|
int templateFunction(int t)
|
|
{
|
|
return t;
|
|
}
|
|
|
|
extern template double templateFunction<double>(double);
|
|
template double templateFunction<double>(double);
|
|
|
|
template<typename T>
|
|
using TemplateFunctionType = T(&)(T);
|
|
|
|
|
|
TemplateFunctionType<int> aliasToTemplateFunction = templateFunction<int>;
|
|
|
|
void f()
|
|
{
|
|
aliasToTemplateFunction(1);
|
|
}
|
|
|
|
void f(int);
|
|
void f(double);
|
|
|
|
void f2()
|
|
{
|
|
function();
|
|
}
|