"ANSI C++ forbids floating-point template arguments" ???
Posted on 2003-11-04
I have a template that is called:
template <class T, T Min, T Max> class Test
I call this template with the following type defs:
typedef Test<unsigned char> Test_byte;
typedef Test<int> Test_int;
typedef Test<float> Test_float;
The compiler does not allow the third typedef: typedef Test<float> Test_float;
It says: "ANSI C++ forbids floating-point template arguments"
I don't understand why this is forbidden! Is there any way around it?
What would be the best solution when you use a template, but you want to use specific values for every instanciated class?
Who can help me out here?