#2174. C++-编译-call of overloaded 'xxx' is ambiguous/'xxx' conflicts...

C++-编译-call of overloaded 'xxx' is ambiguous/'xxx' conflicts...

Background

Description

call of overloaded 'xxx' is ambiguous/'xxx' conflicts with a previous declaration

这里的‘xxx’是函数。函数定义出现了二义性。

这种情况是由于前面有函数定义,后面又自己定义重载函数时,造成函数定义的二义性。

在实际操作中由于自己引起的问题并不多,更多的是自己写的函数在系统中已经有它的定义了,于是编译器认为你写的是重载函数,但是你写的与系统自有的函数又造成了歧义。

举个例子,在<math.h>头文件中包含了abs(x)函数,这个时候再自己写一个abs(x)就会报错:

#include<math.h>
long long abs(long long a){
    return a<0?-a:a;
}
int main(){
    long long b=abs(10000);
}

Format

Input

Output

Samples



Limitation

1s, 1024KiB for each test case.