class MyClass { public: MyClass() {} ... Dispatcher<String> disp; };
Quote: |
Assertion failed in c:\upp\bazaar\Dispatcher.h, line 51 dests.IsEmpty() |
virtual ~Dispatcher() { ASSERT(dests.IsEmpty()); }
class MyClass { public: MyClass() {} ~MyClass() { disp.Clear(); } ... Dispatcher<String> disp; // line 35 };
Quote: |
c:\upp\bazaar\dispatcher\Dispatcher.h(60) : error C2228: left of '.Unregister' must have class/struct/union type is 'Dispatchable<T> ' with [ T=Upp::String ] did you intend to use '->' instead? c:\upp\bazaar\dispatcher\Dispatcher.h(60) : while compiling class template member function 'void Dispatch er<T>::Clear(void)' with [ T=Upp::String ] c:\myapps\MyApp\MyClass.h(35) : see reference to class template instantiation 'Dispatcher< T>' being compiled with [ T=Upp::String ] |
template <class T> class MyDispatcher : public Dispatcher<T> { public: MyDispatcher() {} ~MyDispatcher() { const VectorMap<unsigned,Dispatchable<T>*>& dests=GetDests(); while(dests.GetCount()>0) dests[0]->UnregisterAll(); // * NOTICE '->' INSTEAD OF '.' IN Dispatcher.h CODE!!?? } };
Quote: |
Dispatcher<String> disp |
Quote: |
MyDispatcher<String> disp |
void Clear() { while(dests.GetCount()>0) dests[0].Unregister(); }
void Clear() { while(dests.GetCount()>0) dests[0]->UnregisterAll(); }
void Clear() { while(dests.GetCount()>0) dests[0]->Unregister(*this); }