Могу ли я использовать стандартные функции в шаблоне функций?
Я добавил и написал
#pragma region BlendFunctions
template <class T>
T BlendLightenf(T x, T y)
{
return std::max(x, y); //errors here
}
template <class T>
T BlendDarkenf(T x, T y)
{
return std::min(x, y); //errors here
}
и получите
error C2589: '(' : illegal token on right side of '::'
и
error C2059: syntax error : '::'
прямо в одной строке (x и y обычно float
).
Мои определения:
#ifdef MAGICLIB_EXPORTS
#define CPPWIN32DLL_API __declspec(dllexport)
#else
#define CPPWIN32DLL_API __declspec(dllimport)
#endif
#include <stdio.h>
#include <string>
#include <algorithm>