class myClass {
int arr[100];
public:
void *get(long i, void* const to) const;
void *get(long i, bool nog);
void *tstfn(void* const to) { return get(0L,to); }
};
gcc -Wall dice:C++ Perché la chiamata è ambigua?
dt.cpp: In member function ‘void* myClass::tstfn(void*)’:
dt.cpp:6:49: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: [enabled by default]
dt.cpp:4:9: note: candidate 1: void* myClass::get(long int, void*) const
dt.cpp:5:9: note: candidate 2: void* myClass::get(long int, bool)
Quale tipo di argomento viene fornito come secondo parametro? Chiedo principalmente per curiosità; Probabilmente non mi sarà di grande aiuto. – Tommy
Grazie a tutti! return ((const myClass * const) this) -> get (0L, to); lavorato. –