Re:Libc++'s Implementation of std::string
by gpderetta on Friday January 31, 2020 @05:42AM
(#22200625)
That's true, by definition one char is one byte. What's not guaranteed is that 1 byte is one octet.
Re:Libc++'s Implementation of std::string
by stuffypages on Thursday January 30, 2020 @11:26PM
(#22199043)
Thanks! Fixed.
Re:Libc++'s Implementation of std::string
by stuffypages on Thursday January 30, 2020 @11:41PM
(#22199113)
Interesting, the page you linked also says this.
>Depending on the computer architecture, a byte may consist of 8 or more bits, the exact number being recorded in CHAR_BIT.
I'll add that as an assumption.
You don't really need to make an assumption about being 1 byte wide. That's guaranteed by the standard.
https://en.cppreference.com/w/cpp/language/sizeof