Live data from Hacker News

C++ proposal: There are exactly 8 bits in a byte

open-std.org

41–50 of 357 posts

Re: C++ proposal: There are exactly 8 bits in a byte

#41
post #15

During an internship in 1986 I wrote C code for a machine with 10-bit bytes, the BBN C/70. It was a horrible experience, and the existence of the machine in the first place was due to a cosmic accident of the negative kind.

Somehow this machine found its way onto The Heart of Gold in a highly improbable chain of events.

Re: C++ proposal: There are exactly 8 bits in a byte

#42
post #39

I'm totally fine with enforcing that int8_t == char == 8-bits, however I'm not sure about spreading the misconception that a byte is 8-bits. A byte with 8-bits is called an octet. At the same time, a `byte` is already an "alias" for `char` since C++17 anyway[1]. [1] https://en.cppreference.com/w/cpp/types/byte

I, for one, hate that int8 == signed char.

std::cout << (int8_t)32 << std::endl; //should print 32 dang it

Re: C++ proposal: There are exactly 8 bits in a byte

#46

Earlier quoted context omitted.

It's very useful on hardware that is not an x86 CPU.

As an abstraction on the size of a CPU register, it really turned out to be more confusing than useful.

Is it 32 or 64 bits on ARM64? Why not both?

Re: C++ proposal: There are exactly 8 bits in a byte

#47
Some people are still dealing with DSPs.

https://thephd.dev/conformance-should-mean-something-fputc-a...

Me? I just dabble with documenting an unimplemented "50% more bits per byte than the competition!" 12-bit fantasy console of my own invention - replete with inventions such as "UTF-12" - for shits and giggles.

Re: C++ proposal: There are exactly 8 bits in a byte

#49

Earlier quoted context omitted.

It's very useful on hardware that is not an x86 CPU.

As an abstraction on the size of a CPU register, it really turned out to be more confusing than useful.

Fortunately we have `register_t` these days.

Re: C++ proposal: There are exactly 8 bits in a byte

#50
post #39

I'm totally fine with enforcing that int8_t == char == 8-bits, however I'm not sure about spreading the misconception that a byte is 8-bits. A byte with 8-bits is called an octet. At the same time, a `byte` is already an "alias" for `char` since C++17 anyway[1]. [1] https://en.cppreference.com/w/cpp/types/byte

I, for one, hate that int8 == signed char. std::cout << (int8_t)32 << std::endl; //should print 32 dang it

Now you can also enjoy the fact that you can't even compile:

  std::cout 
because there is no default operator<< defined.
Post reply on HN