MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp/comments/1cjqjmr/messing_with_lifetime/l2jen8f/?context=3
r/cpp • u/pavel_v • May 04 '24
52 comments sorted by
View all comments
Show parent comment
-1
If it was unsigned char there would be no undefined behavior. Only unsigned char and std::byte can alias anything
unsigned char
3 u/Nobody_1707 May 04 '24 Plain char is also allowed to alias, only signed char is forbidden from aliasing. 3 u/gracicot May 05 '24 Hmm, yep I got this one wrong. I forgot those two types are different.
3
Plain char is also allowed to alias, only signed char is forbidden from aliasing.
signed char
3 u/gracicot May 05 '24 Hmm, yep I got this one wrong. I forgot those two types are different.
Hmm, yep I got this one wrong. I forgot those two types are different.
View all comments
Show parent comment
-1
u/gracicot May 04 '24
If it was
unsigned charthere would be no undefined behavior. Only unsigned char and std::byte can alias anything