Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why register storage class is explicitly deprecated [duplicate]

Tags:

c++

standards

In numerical computation in mind, it seems to me that register storage class (which is currently deprecated and removed from the standard) was a good hint for optimization. Was there any specific reason for explicitly removing it from the standard?

like image 588
K.R.Park Avatar asked Dec 22 '22 19:12

K.R.Park


1 Answers

Because it is pretty much useless nowadays. register keywords is nothing more then a hint to the compiler that "you should try to give me fast access to this variable". But compilers are much better than you at measuring such things, especially if you're not actually benchmarking your code.

like image 108
Kaldrr Avatar answered Jan 09 '23 13:01

Kaldrr