gcc: Restricted Pointers

1 
1 7.2 Restricting Pointer Aliasing
1 ================================
1 
1 As with the C front end, G++ understands the C99 feature of restricted
1 pointers, specified with the '__restrict__', or '__restrict' type
1 qualifier.  Because you cannot compile C++ by specifying the '-std=c99'
1 language flag, 'restrict' is not a keyword in C++.
1 
1  In addition to allowing restricted pointers, you can specify restricted
1 references, which indicate that the reference is not aliased in the
1 local context.
1 
1      void fn (int *__restrict__ rptr, int &__restrict__ rref)
1      {
1        /* ... */
1      }
1 
1 In the body of 'fn', RPTR points to an unaliased integer and RREF refers
1 to a (different) unaliased integer.
1 
1  You may also specify whether a member function's THIS pointer is
1 unaliased by using '__restrict__' as a member function qualifier.
1 
1      void T::fn () __restrict__
1      {
1        /* ... */
1      }
1 
1 Within the body of 'T::fn', THIS has the effective definition 'T
1 *__restrict__ const this'.  Notice that the interpretation of a
1 '__restrict__' member function qualifier is different to that of 'const'
1 or 'volatile' qualifier, in that it is applied to the pointer rather
1 than the object.  This is consistent with other compilers that implement
1 restricted pointers.
1 
1  As with all outermost parameter qualifiers, '__restrict__' is ignored
1 in function definition matching.  This means you only need to specify
1 '__restrict__' in a function definition, rather than in a function
1 prototype as well.
1