Is C++ capable of deprecating or simplifying anything? Honest question, haven't followed closely. rand() is broken,I;m told unfixable and last I heard still wasn't deprecated. Is this proposal a test? "Can we even drop support for a solution to a problem literally nobody has?"
C++17 removed trigraphs
C++ proposal: There are exactly 8 bits in a byte
111–120 of 357 posts
Re: C++ proposal: There are exactly 8 bits in a byte
#112D made a great leap forward with the following: 1. bytes are 8 bits 2. shorts are 16 bits 3. ints are 32 bits 4. longs are 64 bits 5. arithmetic is 2's complement 6. IEEE floating point and a big chunk of wasted time trying to abstract these away and getting it wrong anyway was saved. Millions of people cried out in relief! Oh, and Unicode was the character set. Not EBCDIC, RADIX-50, etc.
Yeah, this is something Java got right as well. It got "unsigned" wrong, but it got standardizing primitive bits correct byte = 8 bits short = 16 int = 32 long = 64 float = 32 bit IEEE double = 64 bit IEEE
But it’s not alone in that mistake. All the languages invented in that era made the same mistake. (C#, JavaScript, etc).
Re: C++ proposal: There are exactly 8 bits in a byte
#113Honestly kind of surprised it was relavent as late as 2004. I thought the era of non 8-bit bytes was like 1970s or earlier.
Re: C++ proposal: There are exactly 8 bits in a byte
#114During 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.
I've worked on a machine with 9-bit bytes (and 81-bit instructions) and others with 6-bit ones - nether has a C compiler
Re: C++ proposal: There are exactly 8 bits in a byte
#115Hmm, I wonder if any modern languages can work on computers that use trits instead of bits. https://en.wikipedia.org/wiki/Ternary_computer
Re: C++ proposal: There are exactly 8 bits in a byte
#116Re: C++ proposal: There are exactly 8 bits in a byte
#117Why? Pls no. We've been told (in school!) that byte is byte. Its only sometimes 8bits long (ok, most of the time these days). Do not destroy the last bits of fun. Is network order little endian too?
Re: C++ proposal: There are exactly 8 bits in a byte
#118Earlier quoted context omitted.
Henceforth, it follows that a doublesnack is called a lunch. And a quadruplesnack a fourthmeal.
There's only one right answer: Nybble - 4 bits Byte - 8 bits Snyack - 16 bits Lyunch - 32 bits Dynner - 64 bits
(Ok,. I guess there's a difference between bits and hob-bits)
Re: C++ proposal: There are exactly 8 bits in a byte
#119Earlier quoted context omitted.
Maybe specifying that floats are always IEEE floats should be next? Though that would obsolete this Linux kernel classic so maybe not. https://github.com/torvalds/linux/blob/master/include/math-e...
That line is actually from a famous Dilbert cartoon. I found this snapshot of it, though it's not on the real Dilbert site: https://www.reddit.com/r/linux/comments/73in9/computer_holy_...
Re: C++ proposal: There are exactly 8 bits in a byte
#120Earlier quoted context omitted.
Yeah, this is something Java got right as well. It got "unsigned" wrong, but it got standardizing primitive bits correct byte = 8 bits short = 16 int = 32 long = 64 float = 32 bit IEEE double = 64 bit IEEE
I like the Rust approach more: usize/isize are the native integer types, and with every other numeric type, you have to mention the size explicitly. On the C++ side, I sometimes use an alias that contains the word "short" for 32-bit integers. When I use them, I'm explicitly assuming that the numbers are small enough to fit in a smaller than usual integer type, and that it's critical enough to performance that the ass…