Nihili0@programming.devM to C++@programming.devEnglish · 1 year agoC++17’s Useful Features for Embedded Systemsinterrupt.memfault.comexternal-linkmessage-square2fedilinkarrow-up13arrow-down10file-text
arrow-up13arrow-down1external-linkC++17’s Useful Features for Embedded Systemsinterrupt.memfault.comNihili0@programming.devM to C++@programming.devEnglish · 1 year agomessage-square2fedilinkfile-text
minus-squarephirus@feddit.delinkfedilinkEnglisharrow-up0·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-squareNihili0@programming.devOPMlinkfedilinkEnglisharrow-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.