4 ms·
> You don't get true immutability, since C's const allows its target to be mutated from elsewhere. FWIW, const restrict pointers in C do enforce true immutabil
by LegionMammal978 3y ago
> You don't get true immutability, since C's const allows its target to be mutated from elsewhere.
FWIW, const restrict pointers in C do enforce true immutability: if an object is ever read from such a pointer (or another pointer based on it), then nothing can have modified that object since the pointer's corresponding block began, and nothing can later modify that object until the pointer's block ends. Otherwise, UB occurs.