I have come across the keyword register in C++ and I am curious about its value category. Are the variables created with the register keyword lvalue (because they can be referenced) or rvalue (because they are stored in a processor register and cannot be accessed by a pointer to their address in memory)?
I’ve studied the basic category values at the link above on the cppreference, but I don’t understand where register variables go according to these definitions.
>Solution :
register is deprecated or removed depending on the c++ standard version.
If it wasn’t deprecated then it’d be similar to volatile which alters how the compiler treats the variable but it doesn’t change its value category. You can have a volatile lvalue, rvalue etc.