Message from C, C++ discussions

December 2019

— You are right the memcpy solution is better but the old one shouldn't be a ub because a2 and b2 are copies of the dereferenced punned pointer which are not affected by the address meaning that there is no aliasing second pointer to them. Gonna read the post tough :)

Message permanent page


Probably, but the compiler is free to do any wierd stuff in this case, so I would be at least aware of this

BTW, I forgot to include one of the links (updated my message now)

— And sometimes the compiler does really weird stuff :P

— I am human

— 😭😭😭why the admins restricted me to write here-!!!!

— Would not i get here benifits from the experiers 😭😭

— 14 if remove nodiscard

— Hi

— Hi

— Hello

— Hi

— Hi