更新时间:2022-04-23 00:04:49
std :: max
有多个重载,因此编译器无法确定要调用哪个。
std::max
has multiple overloads, so the compiler is unable to determine which one you want to call. Use static_cast
to disambiguate and your code will compile.
static_cast<int const&(*)(int const&, int const&)>(std::max)
[](int a, int b){ return std::max(a, b); }