util/SpanCast: add ReferenceAsBytes()

This commit is contained in:
Max Kellermann
2023-10-21 13:33:25 +02:00
committed by Max Kellermann
parent 10940da381
commit a073db1e52
3 changed files with 12 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ public:
*/
template<typename T>
void WriteT(const T &value) {
Write(std::as_bytes(std::span{&value, 1}));
Write(ReferenceAsBytes(value));
}
/**