When writing platform independent software in C++, can I nowadays safely assume that a byte has a size of 8 bits?
In theory, no. You could imagine future processors not having 8 bit bytes. Perhaps some weird VLIW processors don't have them.
In practice, yes, for the few next years.
Quantum computers, or old Setun computers,or IBM 7090 don't have bytes.
You could also generate C++ code (or C code), like GNU autoconf or RefPerSys or ANTLR or GNU bison are doing. Or using GPP.
Pitrat's book: Artificial Beings, the conscience of a conscious machine explains the interest of generating C code, and the explanation is extensible to generating C++ code.
Queinnec's book: Lisp In Small Pieces explains in detail how to do so.
Platform portability is somehow a fiction. Projects could generate C++ (or C) code to improve portability to other platforms.
The Qt project is in C++ and contains a C++ code generator, its moc
char.