template <DWORD Size>
class FPSTimer: public BaseClass { // <= Error
public:
DWORD GetFPS();
void UpdatedFPS();
FPSTimer(Timer & Tmr);
private:
double CycleTime[Size];
DWORD CycleCounter;
Timer * pTimer;
};
However I get the error:
"error C2973: 'FPSTimer' : invalid template argument 'Size'"
What cause this error, and how do I fix it?
Thanks in advance.
Template DWORD paramter.
I have the following code:
Quote:Original post by The C modest god
I have the following code:
... snip ...
However I get the error:
"error C2973: 'FPSTimer' : invalid template argument 'Size'"
What cause this error, and how do I fix it?
Thanks in advance.
You have an argument list, but no type list. Are you just trying to template an arbitrary sized array member? ... or do you have another objective? Explain your implementation a little.
:stylin:
sounds like you've forgotten to include windows.h that defines the DWORD type.. I would say use the standard size_t type instead.
Quote:Original post by DigitalDelusion
sounds like you've forgotten to include windows.h that defines the DWORD type.. I would say use the standard size_t type instead.
No it doesnt work if I write int instead.
I gues I dont have to do it template, I can use something else.
However, now I am just curious why it doesnt work.
Are you still using Visual C++ 6? If so, do yourself a favour and upgrade. That code compiles just fine under Borland 5.6.4, gcc 3.3.1 and VC++ 7.1.
Enigma
Enigma
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement