std::bytefor "plain byte data" instead ofchar,unsigned charoruint8_t- use
std::optional<T>for optional return values (kinda obvious, but you have to know) std::variant<T1,T2,...>is a C++ version ofunion- use
std::bitset<N>for bitfields - structured bindings are useful for multiple return values:
std::tuple<std::string, int>> get_name_and_age(); auto [ name, age ] = get_name_and_age();