I
Ioannis Vranos
Just some thought on it, wanting to see any explanations.
It was advised in this newsgroups that we should avoid the use of
keyword register.
However it is a language feature, and if it offers no help to an
implementation, it is free to ignore it. And this happens widely, all my
C++ compilers in my platform ignore this keyword.
Also the use of register provides the additional guarantee that we do
not get the address of this variable which may indeed help an
implementation to optimise the variable access further, which was the
original purpose of its introduction after all.
So why we should not use register?
An implementation taking it into account means that the keyword helps it
indeed, otherwise the implementation *should* ignore it.
It was advised in this newsgroups that we should avoid the use of
keyword register.
However it is a language feature, and if it offers no help to an
implementation, it is free to ignore it. And this happens widely, all my
C++ compilers in my platform ignore this keyword.
Also the use of register provides the additional guarantee that we do
not get the address of this variable which may indeed help an
implementation to optimise the variable access further, which was the
original purpose of its introduction after all.
So why we should not use register?
An implementation taking it into account means that the keyword helps it
indeed, otherwise the implementation *should* ignore it.