0

Are there some low level features of C++ that are growing extinct because of the increasing availability of computer resources like memory, disk space, CPU power etc?

Acha Bill
  • 1,255
  • 1
  • 7
  • 20

3 Answers3

3

Not per-se a C++ feature (it's common to C), but the register specification doesn't do much any more. This used to be a recommendation for the compiler to generate instructions to place some variable in a register, but it's not really useful anymore. When I learned C, the chapter on loops used to be full of

for(register int i ...)
Community
  • 1
  • 1
Ami Tavory
  • 74,578
  • 11
  • 141
  • 185
1

Compilers develop, but the language as such is likely to stay the same (at least old language standards will remain), because otherwise, old code will break.

The inline keyword is no longer meaning "inline this function", but has some semantics based on multiple declarations of the same function in the final binary (there will only be ONE function, rather than multiple functions).

This is an effect of compiler being more clever as to when to inline (most modern compilers will for example inline any function that is static and called only once, regardless of size)

Obviusly, with more hardware resources, the solution may change - if you can write something in Python and it's reasonably speedy, why write it in C or C++? 20 years ago, that project may not even have been possible with hand-written assembler...

Mats Petersson
  • 126,704
  • 14
  • 140
  • 227
1

Bitfields are often pointless nowadays. They typically save only a few bytes per object, but accessing them is slower. So if you're not running out of memory, your program is probably faster without them. (They make a lot of sense when they can prevent your program from swapping to disk; disk is 100x slower than RAM)

MSalters
  • 173,980
  • 10
  • 155
  • 350