I have a code:
#pragma once
namespace iReader {
delegate void BeginHandler();
delegate void EndHandler();
//template <class TEvent> < TROUBLE IS HERE >
delegate void TransitionHandler(int aPrevState, int aCurrentState);
template <typename TEvent>
ref class CFSMTable {
public:
CFSMTable(unsigned int aEventsCount, unsigned int aStatesCount) {
iStates = gcnew array<TEvent, 2>(aEventsCount, aStatesCount);
}
protected:
array<TEvent, 2>^ iStates;
};
};
When I uncomment //template <class TEvent> I have an error
f:\work\.net explorer\ireader\FiniteStateMachine.h(11) : error C3755: 'TransitionHandler': a delegate may not be defined
f:\work\.net explorer\ireader\FiniteStateMachine.h(11) : fatal error C1903: unable to recover from previous error(s); stopping compilation
As I undestand form MSDN article (http://msdn2.microsoft.com/en-us/library/41y18zex.aspx) it means that I not simply declared but already define the template.
How it could be It’s only declaration.
Cound you give me a clue to this problem.
Thank you
Visual C++3
|