我有以下代码:
class Foo
{
public:
BOOL GetBar(char** ptr);
private:
BOOL GetBar(char** ptr, ...);
};
Foo* aFoo = ...;
char* aPtr = ...;
BOOL res = aFoo->GetBar(&aPtr);//error C2668
会产生以下错误:
error C2668: 'Foo::GetBar' : ambiguous call to overloaded function
Foo.h: could be 'BOOL Foo::GetBar(char **,...)'
Foo.h: or 'BOOL Foo::GetBar(char **)'
while trying to match the argument list '(char **)'
有没有办法在不重命名其中一个GetBar函数的情况下修复此错误?
(Visual Studio 2005)