Nihili0M to C++English · 1 year agoC++17’s Useful Features for Embedded Systemsinterrupt.memfault.comexternal-linkmessage-square2fedilinkarrow-up111arrow-down10file-text
arrow-up111arrow-down1external-linkC++17’s Useful Features for Embedded Systemsinterrupt.memfault.comNihili0M to C++English · 1 year agomessage-square2fedilinkfile-text
minus-squarephirus@feddit.delinkfedilinkEnglisharrow-up1·1 year agoI also like to use std::optional if a function may not return a result so I won’t have to return a pointer, that might be a nullptr. And std::variant as a typesafe less hacky union.
minus-squareNihili0OPMlinkfedilinkEnglisharrow-up1·1 year agoI agree, I’m also hyped by std::expected, though it’s C++23, so it will be quite some time before we can use it in production but still, it can easily be added as it’s just a class.
I also like to use std::optional if a function may not return a result so I won’t have to return a pointer, that might be a nullptr.
And std::variant as a typesafe less hacky union.
I agree, I’m also hyped by std::expected, though it’s C++23, so it will be quite some time before we can use it in production but still, it can easily be added as it’s just a class.