欢迎加入我们的QQ群,无论你是否工作,学生,只要有c / vc / c++ 编程经验,就来吧!158427611
如果出现编译错误。
//private\sktfitsin.h(68): error C2589: “(”:“::”右边的非法标记
//private\skto.h(14): note: 参见对正在编译的函数 模板 实例化“bool SkTFitsIn<D,S>(S)”的引用
template <typename D, typename S>
static constexpr inline
typename std::enable_if<(std::is_integral<S>::value || std::is_enum<S>::value) &&
(std::is_integral<D>::value || std::is_enum<D>::value), bool>::type
/*bool*/ SkTFitsIn(S src) {
// SkTFitsIn() is used in public headers, so needs to be written targeting at most C++11.
return
// E.g. (int8_t)(uint8_t) int8_t(-1) == -1, but the uint8_t == 255, not -1.
(std::is_signed<S>::value && std::is_unsigned<D>::value && sizeof(S) <= sizeof(D)) ?
(S)0 <= src :
// E.g. (uint8_t)(int8_t) uint8_t(255) == 255, but the int8_t == -1.
(std::is_signed<D>::value && std::is_unsigned<S>::value && sizeof(D) <= sizeof(S)) ?
src <= (S)(D)std::numeric_limits<D>::max() :
//定位到这一行有error
//private\sktfitsin.h(68): error C2589: “(”:“::”右边的非法标记
//private\skto.h(14): note: 参见对正在编译的函数 模板 实例化“bool SkTFitsIn<D,S>(S)”的引用
else
(S)(D)src == src;
}
不要慌~
遇事不决,量子力学。
那是 因为windows.h中也定义了min max宏,和 std::numeric_limits中的同名宏冲突了。
这个时候,只需要项目文件,或者stdafx.h中 增加宏
#define NOMINMAX
即可
欢迎加入我们的QQ群,无论你是否工作,学生,只要有c / vc / c++ 编程经验,就来吧!158427611