草庐IT

c++ - 一个函数的三个不同定义,没有链接器错误;怎么可能?

我有一些在我看来非常不可能的事情。我有三个文件,每个文件似乎都包含完全相同的函数声明,尽管定义不同。inst_dp_vec2.cc:voidloadSOAFVec(InstVector&ivector,constFVec&ret,constAddress*a,intsoanum,intsoalen,stringmask){if(soalen==2){ivector.push_back(newLoadFVec(ret,a,string("")));}else{printf("SOALEN=%dnotsupportedat%s:%d\n",soalen,__FILE__,__LINE__)