S
Sergio
Hi, I was trying to implement functions with data associted to it
sequentialy, I tried the following way(below), but that does not comply
with the compiler norms for C++ even though that's not any semantic or
sintax error..., does any one knows a way to do that?
Thanks
Code:
template<int *INT_POINTER>
class ClassA
{
public:
static void P(){}
};
int x[3];
typedef void(*VOIDFUNCVOID)();
VOIDFUNCVOID functions[3];
int main()
{
for(int i=0;i<3;i++)
/*error C2964: invalid expression as template parameter*/
functions=ClassA<&x>:
;
return 0;
}
sequentialy, I tried the following way(below), but that does not comply
with the compiler norms for C++ even though that's not any semantic or
sintax error..., does any one knows a way to do that?
Thanks
Code:
template<int *INT_POINTER>
class ClassA
{
public:
static void P(){}
};
int x[3];
typedef void(*VOIDFUNCVOID)();
VOIDFUNCVOID functions[3];
int main()
{
for(int i=0;i<3;i++)
/*error C2964: invalid expression as template parameter*/
functions=ClassA<&x>:
return 0;
}