1

There are three entities named around restrict for which I wonder if there is any clear or subtle distinction:

Are these entities virtually always interchangeable in terms of their functionality?

Konrad Rudolph
  • 530,221
  • 131
  • 937
  • 1,214
Herpes Free Engineer
  • 2,425
  • 2
  • 27
  • 34
  • 5
    `restrict` is not part of C++. Some compilers provide equivalent as extension. – Jarod42 May 23 '20 at 16:13
  • 2
    It's not really needed in C++, since (other than `char*`) everything is pretty much `restrict` assumed. – Eljay May 23 '20 at 16:20
  • 2
    @Eljay: strict aliasing rule (C and C++) only prevents aliasing between "different" types (with indeed `char*` exception). For same type, aliasing might/does occur. So `restrict` would be useful but it is dangerous (breaking contract lead to UB)... – Jarod42 May 23 '20 at 16:35
  • https://en.cppreference.com/w/c/language/restrict – Jesper Juhl May 23 '20 at 16:42

0 Answers0