Например:
Код: Выделить всё
template
class A
{
public:
template
std::enable_if_t run(float a, float b)
{
return a + b;
}
};
class B
{
public:
float run(float a, float b)
{
return a + b;
}
};
Код: Выделить всё
HasRun::value; //
Подробнее здесь: [url]https://stackoverflow.com/questions/78552025/how-to-check-whether-a-function-template-exists-in-c[/url]
Мобильная версия