Re:C++17 is formally approved
by nly on Thursday September 07, 2017 @07:32PM
(#15196736)
> I don't usually think of structs by the order the properties are declared
In C++ you have to, since it's guaranteed by the language that members are initialized in order of declaration (within the struct). And, like C of course, it also determines memory layout, padding and alignment
> Are structs typically ordered data structures in c++
Yes, and compilers like Clang even let you inspect their memory layout
In C++ you have to, since it's guaranteed by the language that members are initialized in order of declaration (within the struct). And, like C of course, it also determines memory layout, padding and alignment
> Are structs typically ordered data structures in c++
Yes, and compilers like Clang even let you inspect their memory layout