// 函数调用
void Migrate::process(const DSReferenceID& id,const TapeName& oldtape)
{
bool ok;
Transaction(this,&Migrate::exists,id,oldtape,ok);
if(!ok)
{
Log::info() << oldtape <<
" does not exist in "
<< id << endl;
return;
}
}
//重载函数
//函数1
template <class Caller,class Arg1,class Arg2,class Arg3>
inline void Transaction(Caller* caller,void (Caller::*proc)(Arg1&,Arg2&,Arg3&),Arg1& arg1,Arg2& arg2,Arg3& arg3)
{
TransactorM3<Caller,Arg1&,Arg2&,Arg3&>(*caller,proc,arg1,arg2,arg3).update();
}
//函数2
template <class Caller,class Arg1,class Arg2,class Arg3>
inline void Transaction(Caller* caller,void (Caller::*proc)(Arg1&,const Arg2&,Arg3&),Arg1& arg1,const Arg2& arg2,Arg3& arg3)
{
TransactorM3<Caller,Arg1&,const Arg2&,Arg3&>(*caller,proc,arg1,arg2,arg3).update();
}
//函数3
template <class Caller,class Arg1,class Arg2,class Arg3>
inline void Transaction(Caller* caller,void (Caller::*proc)(const Arg1&,Arg2&,Arg3&),const Arg1& arg1,Arg2& arg2,Arg3& arg3)
{
TransactorM3<Caller,const Arg1&,Arg2&,Arg3&>(*caller,proc,arg1,arg2,arg3).update();
}
//函数4
template <class Caller,class Arg1,class Arg2,class Arg3>
inline void Transaction(Caller* caller,void (Caller::*proc)(const Arg1&,const Arg2&,Arg3&),const Arg1& arg1,const Arg2& arg2,Arg3& arg3)
{
TransactorM3<Caller,const Arg1&,const Arg2&,Arg3&>(*caller,proc,arg1,arg2,arg3).update();
}
我认为应该调用“函数4”,但编译的时候报
调用重载的‘Transaction(Migrate* const, void (Migrate::*)(const DSReferenceID&, const TapeName&, bool&), const DSReferenceID&, const TapeName&, bool&)’有歧义 |