|
From: <or...@vp...> - 2004-04-09 16:18:53
|
Malcolm Nealon wrote: > CMMPointer<CGlobalTimer> globalTimer =3D new CGlobalTimer(); > globalTimer->priority=3D10; > //the CMMPointer<ITask> expression here is used to typecast > //the pointer from CGlobalTimer* to ITask* > CKernel::GetSingleton().AddTask(CMMPointer<ITask>(globalTimer)); >=20 > with this error >=20 > no matching function for call to `CKernel::AddTask( CMMPointer<ITask>)' > candidates are: bool CKernel::AddTask(CMMPointer<ITask>&) >=20 > From reading the forum I understand this is an error in temporary > referenceing which GCC doesn't allow. Any ideas how to correct the > code so that it compiles correctly. I haven't compiled it myself, but I suspect AddTask doesn't take it's=20 parameter as const. If so, modify the declaration of AddTask to take=20 it's parameter as const. If that's not possible because AddTask actually=20 modifies it's parameter (which doesn't really makes sense to me), then=20 create some temporary variable before AddTask and pass that. -- Greetings, Bal=E1zs |