I have a function that gets an array of pointers, for example:
void foo(int *ptrs[], int num, int size) { /* The body is an example only */ for (int i = 0; i < size; ++i) { for (int j = 0; j < num-1; ++j) ptrs[num-1][i] += ptrs[j][i]; } }
What I want to pass to the compiler is that the ptrs[i] pointers are not aliases of each other and that the ptrs[i] arrays do not overlap. How can I do it? My hidden motive is to encourage automatic vectorization.
Also, is there a way to get the same effect as __restrict__ on the std::vector iterator?
c ++ c pointers restrict-qualifier aliasing
san
source share