Is there an attribute to tell the compiler that the value of a const object reference/pointer parameter is truly not modified
I tried restrict but it seems that it still notbthe case ,
I'm not talking about the unsequensed ,gcc pure , const and similar c attributes that apply to the whole function , I mean something like ( im not a wg21 guy , but looking at c wording for restrict i can peace something) :
For a stable pointer to a const type T , P existing in block B , if any value V with address A is accessed through a pointer originating from P , for as long as the block B is active , the statement
memcmp(std::addressof(V),A,sizeof(V))==0 must be true, otherwise the behavior is undefined
https://redd.it/1oa8w6c
@r_cpp
Post #24081
25