error C2039 min 不是 std 的成员

报错

1>supportedfeaturespacket.cpp
1>..\communication\packet\supportedfeaturespacket.cpp(32): error C2039: “min”: 不是“std”的成员
1>D:\Software\Microsoft\Visual Studio\2022\Professional\VC\Tools\MSVC\14.16.27023\include\set(18): note: 参见“std”的声明
1>..\communication\packet\supportedfeaturespacket.cpp(32): error C2065: “min”: 未声明的标识符
1>..\communication\packet\supportedfeaturespacket.cpp(32): error C2062: 意外的类型“unsigned int”

std::min std::max 如果提示 error C2039 max 不是 std 的成员,同样添加下面头文件即可

解决方法

添加头文件即可

#include <algorithm>

留下评论

您的电子邮箱地址不会被公开。 必填项已用 * 标注