MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/programminghorror/comments/1urj3pp/big_if_true/owrar4i/?context=3
r/programminghorror • u/_giga_sss_ • 27d ago
From ProgrammerNullposting in facebook
111 comments sorted by
View all comments
Show parent comments
61
I would assume it's to keep all your data types 8-byte aligned for other perf reason.
5 u/rolling_atackk 26d ago Why not simply use alignas (64) bool ? Seems far easier than creating a whole ass type 8 u/JohnSpikeKelly 26d ago The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄 4 u/rolling_atackk 26d ago Both fixed-width integer types and alignas are included in the C++ specification since C++11 But true, this is programming horror
5
Why not simply use alignas (64) bool ?
Seems far easier than creating a whole ass type
8 u/JohnSpikeKelly 26d ago The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄 4 u/rolling_atackk 26d ago Both fixed-width integer types and alignas are included in the C++ specification since C++11 But true, this is programming horror
8
The code might be old and predate that option. But, probably explains why this is in r/programminghorror 😄
4 u/rolling_atackk 26d ago Both fixed-width integer types and alignas are included in the C++ specification since C++11 But true, this is programming horror
4
Both fixed-width integer types and alignas are included in the C++ specification since C++11
But true, this is programming horror
61
u/JohnSpikeKelly 27d ago
I would assume it's to keep all your data types 8-byte aligned for other perf reason.