Why can't a template function with a package of pointer template parameters be created using offsets of the same pointer?
I mean: given this short code, why should I comment on the last two lines?
template <int * ... pt> void f() {}
int n[] = {1, 2, 3};
int m = n[1];
int main()
{
f<n>();
f<n, &m>();
}
Does n+1the same address match &m? Or is there a difference in communication? Or what else?
source
share