Hi there!
I can't understand why addresses of array elements cannot appear as non-type parameter in class template. I know that something like this:
is dereferencing (in line 8), beacuse:Code:int array[3] = {45, 57, 24}; //... template <int *p> class X { }; void fun() { X<&array[1]> xxx; }
But I don't know why compiler can't accept this expression:Code:&array[1] = &(*(array+1))
Thank you.Code:X<array + 1> xxx;




Reply With Quote