C++11 introduced a concept of standardized attribute syntax. I couldn't find the list of all supported attributes. Is there a C++11 attribute alternative to __attribute__((packed))
?
e.g.
struct __attribute__((packed)) Pack {
uint8_t field1;
uint8_t field2;
};
Unfortunately, no. The attributes the standard currently defines are:
[[noreturn]]
;[[carries_dependency]]
;[[deprecated]]
/[[deprecated(reason)]]
;Everything else is implementation-defined.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With