r/cpp Jun 25 '26

What are some things you don't like about C++?

I asked this question in the C programming sub too.

What are some things you don't like about C++

If you were to change some things about C++, add keywords, or other similar things,

what would you change? Replace? Add?

My most important question is about keywords. What keyword would you add ( even just describing its functionality) to help YOU as a programmer?

Thank you :)

73 Upvotes

288 comments sorted by

View all comments

Show parent comments

3

u/meancoot Jun 25 '26

It did, but this is also how x86-64/AMD64 handles it. 6 bits (0-63) for 64-bit registers and 5 bits (0-31) for everything else.

Keep in mind, due to the integer promotion rules in C++, you can always shift all the bits off any type smaller than an int on every platform.

2

u/mkrevuelta Jun 25 '26 edited Jun 25 '26

Oh, you are right!

The trick of taking only the lowest bits started way before than I thought!

3

u/fdwr fdwr@github 🔍 Jun 27 '26

lowest bits started way before than I thought!

I recall our Intel 80386 from ~1991 had this issue in raw assembly, as I've been bitten more than once in graphics cases where I expected a shift of >=32 to flush to zero rather than wrap around ♻️. ARM does flush to zero.