Removing the 'register' Keyword

'register' allowed us to store a variable in a registers. Let's see why it has been deprecated.

The register keyword was deprecated in 2011 (C++11), and it has no meaning since that time.

It was removed in C++17. The keyword is reserved and might be repurposed in future revisions of the Standard (for example auto keyword was reused and now is an entirely new and powerful feature).

If you use register to declare a​ variable, you will get a warning:

Get hands-on with 1200+ tech skills courses.