Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
mwkaufma
· 5mo ago · 0 comments
If you know you want bytes -- A void* of unknown provenance cast to anything other than char* is UB so just skip the middleman and use char*.
Comments
[–]
s28l
5mo ago
char* can also be a C-style string. std::byte has the same special treatment in the standard as char and unsigned char, with the added benefit of not being used for other purposes (i.e. ASCII character or uint8, respectively).
[–]
mwkaufma
OP
5mo ago
I was trying to appeal to OPs maladaptive "C++ that looks like C is more legitimate" aesthetic preference, haha.