gpt4 book ai didi

c++ - 由于删除的功能调用不明确?

转载 作者:太空狗 更新时间:2023-10-29 23:49:38 24 4
gpt4 key购买 nike

在代码中

void Fnc( long = 10 ) { }
void Fnc( ) = delete;

int main( int, char** )
{
Fnc( );

return 0;
}

在 Func 调用中,我的编译器提示调用不明确。帮助!我不明白为什么会这样。

最佳答案

根据 Delete Function Definition :

The definition form "=delete;" indicates that the function may not be used. However, all lookup and overload resolution occurs before the deleted definition is noted. That is, it is the definition that is deleted, not the symbol; overloads that resolve to that definition are ill-formed.

这就是为什么你会收到模棱两可的电话。

关于c++ - 由于删除的功能调用不明确?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38565358/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com