News for hackers. Stuff that matters.
Re:Libc++'s Implementation of std::string by Thorrez on Thursday January 30, 2020 @11:13PM (#22198971)
> I will assume that ... the char type is signed and 1 byte wide.

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

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.

Re:Libc++'s Implementation of std::string by thedance on Thursday January 30, 2020 @11:49PM (#22199158)
Does it make a difference? It doesn't seem like your article relies on CHAR_BIT being 8.